I am just trying a simple code which executes on a form submission ( self). It runs perfect in local. But shows "Error: No database selected" in the remote server. Can anyone say why ?
Thank you
<?PHP
$con = mysql_connect("localhost","aby","pass123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("lola", $con);
if ($_POST)
{
$name=$_POST['name'];
$address=$_POST['address'];
$phone=$_POST['phone'];
$iemail= $_POST['Email'];
$pass=$_POST['password'];
$sql="INSERT INTO works(name,address,phone,Email,password)VALUES('$name','$address','$phone','$iemail','$pass')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
}
?>