I am exploring PHP and MYSQl connection.
With great difficulty i have been able to get php, mysql and apache all working.
I tried a simple code
Code: Select all
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<h2>
Testing MySQLConnect
</h2>
<?php
$link = mysql_connect('localhost', 'root', 'root');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo '<p>Connected successfully </p>';
mysql_close($link);
?>
</body>
</html>
"; mysql_close($link); ?>
Not able to figure out why this is happening. The output looks like this in text format
#########################
Testing MySQLConnect
Connected successfully
"; mysql_close($link); ?>
#########################
Please help me.
thanks