Hello!
Please forgive me if I am not posting in the right forum. I am new to PHP and my boss wants me to build an app using MYSQL.
So far, I have been trying to connect to my local mySQL database but to no avail. I wrote this page test.html on my sandbox
<html>
<body>
<?php
$con = mysql_connect("localhost","root","somepassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else echo "Connected";
mysql_close($con);
?>
</html>
</body>
When I go to http://localhost/test.html to test it, nothing happens. No errors. Not even the "Could not connect" error message.
I even tried re-install the RPMs for MySQL/PHP : no change. The weird part is that I am able to connect from the command line to MYSQL, use databases, run queries etc...
What am I doing wrong? Can someone please help?
My sandbox config is:
RedHat 2.6.9 el
Apache 2.2.3
PHP 5.16
MySQL 5.0
Thanks.
Al