I’m using this query (I changed it):
// SQL query
$squl = "INSERT INTO 'messages' ('id','name' ,'email' ,'subject' ,'content','userid') VALUES ( null,'".$name."', '".$mail."', '".$subject."', '".$content."','');";
// mysql query
$query = mysql_query($squl) or die("message query problem: ". mysql_error());
I get 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 ”messages’ (‘id’,’name’ ,’email’ ,’subject’ ,’content’,’userid’ )VALUES ( null,” at line 1
What is causing this?
.``)You used a period here instead of a comma so the function is only receiving 5 columns when it needs 6.Update:
As the commenter below points out, you’ve replaced the backticks with quotation marks.