Hey guys!
I'm new to this forum and to PHP, so I have a problem. I'm following a Video Tutorial I downloaded, which was made in May of 2002, has proved to be fairly accurate. My question is about the syntax, or something, in a PHP script they told me to write, very basic, in order to connect to MySQL. It worked on their computer but not mine. We, needlessly to say, don't have the same versions of PHP, MySQL, and Apache, but I haven't run into any problems until now. I copied their script, word for word, after it failing when I did it from memory, but it still didn't work. I'm guessing it has something to do with Windows XP, since I find this all much easier on Linux.
Here are the scripts:
config/db_config.php
<?php
$db_host = "localhost";
$db_user = "php";
$db_password = "PASSWORD";
$db_name = "DATABASE";
?>
temp_con.php
<?php
require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die ("error connecting");
echo "connection made";
?>
Every time that I run the script, "temp_con.php," in my browser, Internet Explorer, it just reads, "error connecting," but I can connect to MySQL through the command line.