Hello! I'm working on a simple messaging system for a project and I have this query and it isn't working for some odd reason, here it is:
mysql_query("INSERT INTO messages SET
user='$user',
message='$msg',
date='$date',
to='$id',
private='$checked'
")
Here is my 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 'to='4', private='0'' at line 5
Not quite sure what it's saying, I'm not trying anything new I'm using the same syntax as I always do in my queries. But I know me I might just need someone to point something obvious out, but who knows. Thanks for any help, and sorry if it's obvious! (And yes I have tested all variables being used, they are valid.)