April 19, 2024, 10:40:04 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: php script not working  (Read 3802 times)

Offline sekhar_vrc

  • Linux Noob !
  • *
  • Posts: 18
php script not working
« on: October 09, 2004, 01:57:37 PM »
dear sir

               When i am trying to create a data base using php i  am encountering
the folllowing error

"Fatal error: Call to undefined function: mysql_connect()"

the script is given below (ctable.php)


<?
$user="root";
$password="xyz123";
$database="allusers";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
mysql_close();
?>


please guide me

with regards
sekhar

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
php script not working
« Reply #1 on: October 12, 2004, 08:16:31 AM »
It seems to me that mysql is not enabled in your PHP . .you need to enable it .. check it by ..

phpinfo() directive and look for mysql is enabled or not !

if it is not there then install from the redhat installation cds ..