Posted by christopher_board on 05/07/07 19:59
Hi all. I am trying to connect to a MySQL Database using PHP on a
local machine using locahost. I am using the following code
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or
die ('Error connecting to mysql');
$dbname = 'pmoneytest';
mysql_select_db($dbname);
?>
When I view the page it then comes up with an error that says
PHP Fatal error: Call to undefined function mysql_connect() in C:
\Inetpub\wwwroot\PHPTest\connection.php on line 6. I can't see what
the problem is as I got the code from the Internet and it seems to be
the same on all the different website that I look at.
Thanks very much for your help and I look forward to hearing from you
in the near future.
Navigation:
[Reply to this message]
|