2016-08-08

I am trying to make a query in mysql using php, but I can't display the resutlts because I have an error in the query. That is the code:

When I run the query I display the error:

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 '' at line 1

I inserted an echo and the query displayed with echo is the following:

So a ) is missed but I typed it in the query. Why a ) is missed? How can I display the query correctly?

Thanks.

Show more