I have the following MySQL query:
INSERT INTO ipi_messages (Message_userID, Message_fromName, Message_fromEmail, Message_subject, Message_body) VALUES(`0`, `hope`, `thisworks@gmail.com`, `i hope`, `this works`)
My database schema is:
I cannot, for the life of me, figure out how that error is even possible. Why would MySQL try to find 0
as one of the columns? It is clearly not even in the column declaration piece of the code.
So why am I getting the error Unknown column '0' in 'field list'
?
Answer
You need to use regular quotes '
for string values. Backquotes are used to enclose column and table names.
No comments:
Post a Comment