I pull my hair for this, which is not the case with this query:
SELECT COUNT(id), * FROM location WHERE country = '$country' AND LCASE(namenodiacritics) LIKE LCASE('%$locname%') ORDER BY name ASC
Am I allowed to use COUNT (id) and * in the same request?
I keep getting this error:
You have an error in the SQL syntax; check the manual that matches your MySQL server version for the correct syntax to use next to '* FROM location WHERE country =' AQ 'AND LCASE (namenodiacritics) LIKE LCASE (' %% '' on line 1
It is strange that it works with "SELECT COUNT (id) FROM ..." as well as "SELECT * FROM ...".
source share