Here is my table schema:
- text_field1 text
text_field2 text
text_field3 text
text_field4 text
created_date datetime
bool1 tinyint(1)
num_of_days int(11)
bool2 tinyint(1)
bool3 tinyint(1)
bool4 tinyint(1)
name_field1 varchar(25)
long_msg1 longtext
Code: Select all
mysql_query("INSERT INTO msgtbl (text_field1, text_field2, text_field3, text_field4, created_date, bool1, num_of_days, bool2, bool3, bool4, name_field1, long_msg1')
VALUES ('$text_val1', '$text_val2', '$text_val3', '$text_val4', CURDATE(), '0', '7', '1', '1', '0', '$name_val1', '$my_msg')") or die(mysql_error());
And here is the error it is returning:
What do I have malformed in my sql query?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 '') VALUES ('4883032953', 'Anonymous', 'Anonymous', 'No Subject', CURDATE(), '0'' at line 1
Thank you.
-Joe