I have a table with two fields (id and word).
Can anyone enlighten me as to why:
$query0 = "SELECT * FROM words WHERE id IN ($treated_words) ";
is a valid query. But:
$query0 = "SELECT * FROM words ORDER BY id ASC WHERE id IN ($treated_words) ";
is not. Many thanks
Order of elements in a SQL query matters. The
ORDER BYclause must appear after theWHEREclause.Look to the MySql docs for syntax rules. You’ll see something like