php-mysql problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
 I have redhat 9.0 and Server version: Apache/2.0.40. 
 i have installed rpms php-4.2.2-17.2.i386.rpm
 php-mysql-4.2.2-17.2.i386.rpm


After i create a database called mydb and serveral tables in mysql,
I tried to run following testdb.php script 


------------------------------------------------------------------
<html>
<body>
<?php
$db = mysql_connect("localhost", "root","xxxxxx");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM employees",$db);
printf("First Name: %s<br>\n", mysql_result($result,0,"first"));
printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));
printf("Address: %s<br>\n", mysql_result($result,0,"address"));
printf("Position: %s<br>\n", mysql_result($result,0,"position"));
?>
</body>
</html>
---------------------------------------------------------------

but i got error message with:
http://coopunit.forestry.uga.edu:8080/testdb.php
the error is:
Fatal error: Call to undefined function:
mysql_connect() in /var/www/html/testdb.php on line 13

How can Fix this problem? Thanks 


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux