This is my Php file code. When i insert the data using input fields in HTML i get the Error could not enter data. No database selected.
$dbhost="localhost";
$dbuser="root";
$dbpass="";
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$sql = 'INSERT INTO sale '.
'(Name, Contact, Email, Property_type, Price, Location) '.
'VALUES ( "$a", "$b", "$c", "$d", "$e", "$f" )';
mysql_select_db('gharghar_gharastee');
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
?>