| 1. |
Solve : MySql syntax error?? |
|
Answer» Heres the code: INSERT INTO inbox (to, from, id, sent, read, title, contents) VALUES ('$to', '$from', '$id', '$sent', 'false', '$sub', '$txt')The "read" field - is that a boolean? If so, remove the apostrophes around "false".Na, read is a text. Booleans don't work for me, for some reason. And yes, all the tables exist. Also, id is a number value. I tried making it $id, but it didn't work. And, contents is a LONGTEXT. Are the values too big for any of the fields? Ex: if the field for ID is INT(2), and the value $id is 111.Have you tried assigning the variables in the document just to see if it works? Then you would know if it's an error with the insert or getting the variables.Yes, I tried USING php on a page. It didn't do anything. And kpac, its INT(11), and the value is 2I think I realise what's wrong here. Notice in the SQL error, "to", "from", and "read" are in uppercase. I'm PRESUMING they're reserved keywords? Try changing the field NAMES to something else. |
|