Skip to content
Advertisement

Syntax error possibly due to multiple ANDs?

I first got the error in php, and I then tested it in phpmyadmin and I get an error. It doesn’t specify why there is an error it just saying an error with the syntax. I thought it maybe because there is multiple AND clauses but I put them in brackets to maybe simplify it but it didn’t help 🙁 Anyone any ideas?

Advertisement

Answer

The correct syntax is:

That said, your query should qualify all column references. You can still get an invalid time. Also, using LIKE on a date/column is wrong. So is storing a date as a string. If I assume that the value is really a date and speculate on where columns come from, then the query should look something like this:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement