anonymous
2011-07-05 12:02:38 UTC
but it's not working.
I have table " check " with these fields (id , email).
Now I'm trying to insert data in this blank table by this script
session_start();
$email = $_SESSION['email'];
if(isset($_POST['submit'])) {
$error = "Unable to Connect.";
$connect = mysql_connect("localhost","root","") or die ($error);
mysql_select_db("mydatabase") or die ($error);
mysql_query("INSERT INTO check VALUES ('', '$email')") or die(mysql_error());
}
else
echo "Error";
?>
and it is giving this error
" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check VALUES ( ' ', 'sallu_98@yahoo.com')' at line 1 "
Tell me how to solve it.?