Forum Moderators: coopster
Here's the code
$table = 'messages';
$sql = "INSERT INTO $table (from, to, title, message, time) values ('$from', '$to', '$title', '$message', '$time')";
mysql_query($sql) or die(mysql_error()); Now, to state the obvious, all variables are defined and working. The table and all feilds exist and should work. I also use a very similar code elsewhere on the site with noo problems.
Anyone know whats wrong?
INSERT INTO messages (from, to, title, message, time) values (me', 'you', 'title test', 'message test', 'March 12, 2006, 7:49 am')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 'from, to, title, message, time) values ('me', 'you', 'title test', 'message t' at line 1