Try this code at the top…
<?php $con = mysql_connect(“localhost”,”DATABASE NAME”,”DATABASE USER NAME”);
if (!$con)
{ die(‘Could not connect: ‘ . mysql_error()); }
$db_selected = mysql_select_db(“DATABASE NAME”, $con);
if (!$db_selected)
{die (“Can\’t use test_db : ” . mysql_error()); }
?>