Forum Moderators: coopster
I am totally new to php and i am using Dreamweaver 8. I am trying to create a page to initiate connection to the MySQL Server 5.0 at localhost, but the browser returns me this error message:
"Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\My_PHP\connect_to_mysql.php on line 11"
The testing code i was trying as below:
<?php
$connection = mysql_connect('localhost', 'root', 'password');
if (!$connection) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($connection);
?>
More information of what i am using:
MySQL Server V.5.0.18-nt
PHP Version 5.1.4
Server_Name/HTTP_Host: localhost
Server_Software: Microsoft-IIS/5.1
Windows XP SP2
Please help me to solve my problem. Please tell me if you need more details.
Thank y'all very much!
Refer to this thread on Installing a new web server: Apache2, PHP5, MySQL4 and PHPmyAdmin [webmasterworld.com] for more information.
Good luck!
The steps for enabling mysql in the php.ini are the same. Uncomment this line in your php.ini:
extension=php_mysql.dll
If phpinfo() isn't working then there is something wrong with your PHP installation although from your first post you have a PHP-generated error; I wonder what's going on here. A little fishy, I might add. ;)