Question on MySQL and PHP
Posted on 2000-01-10
I am trying to write a page in PHP3 running on my Redhat 6.1. I have Apache 1.3.9, MySQL 3.22.27 and PHP 3.0.12 running ok. However, when I want to the following code running my Linux:
$db = mysql_connect('localhost', 'root','');
$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"));
I have the following error:
Fatal error: Call to unsupported or undefined function mysql_connect() in /home/httpd/html/php/showdb.php3 on line 11
It seems that I need to do connections for the PHP an MySQL. However, most of the document I found on the web just teaching me install and recompile the php3 and mysql from scratch. Do I really need to do it? Can I just change some config file and restart the services? If yes, which file I should change.
I would be appreciated if there is a step by step instruction for!