I have the following error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/portconnect/index.php on line 13
For the following line of code:
<html>
<body>
<?php
$connection=mysql_connect("localhost","","");
if (!$connection){
echo "Could not connect to MySQL server!";
exit;
}
$db=mysql_select_db("test",$connection);
if (!$db) {
echo "Could not....";
exit;
}
$sql="SELECT * FROM Month";
$mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result);
if($num_rows == 0) {
echo "Sorry....";
exit;
}
else {
echo "<table>";
while($row=mysql_fetch_array($mysql_result)) {
$date=$row["date"];
$place=$row["place"];
$description=$row["description"];
$ID=$row["ID"];
echo "<tr><td>$date</td><td>$place</td><td>$description</td></tr>";
}
}
mysql_close($connection);
?>
</body>
</html>