[Solved] What is wrong with this sql statement?


First error: field names should be enclosed in backticks, not quotes. (and even then, the backticks are only necessary if the field name is a reserved SQL word or contains special characters. Generally it’s a good idea to have backticks, but in your example you can get away without them)

Second error: missing closing bracked on end of query.

Possible error: Make sure all the variables you’re using are properly escaped. Failure to do so will result in your code being vulnerable to SQL injection attacks. (I can’t tell if this is actually a problem for you without seeing more of your code)

Style issue: you’re mixing your quotes between single and double quotes without any good reason. ie some of your values are in single quotes, others are in double quotes. Be consistent. Also, all those escaped single quotes make the whole thing very hard to read!

solved What is wrong with this sql statement?