I having difficult time finding out the problem with the syntax in the query:pastebin
In the pastebin you will also see the message I get.
As you see it is executed using a perpared statement…furthermore if I run the exact same query in the console(Netbeans IDE) everything goes OK.
Here is the query that runs OK in the console:
select count(*) from appointments WHERE appont_close_time BETWEEN '2016-02-01' AND '2016-02-04' AND bookedfor=(select user_ID from users where concat(name,' ',lastname) like 'kostas kouloglou') AND apps_origin='frontend';