I have an sql sentence like this:
$sql = "SELECT *, films.category AS filmCategory FROM films LEFT OUTER JOIN items ON items.unique = films.ref ORDER BY unique ASC LIMIT 0, 4";
that doesn't work. It works without the ORDER BY
and LIMIT
parts, like this:
$sql = "SELECT *, films.category AS filmCategory FROM films LEFT OUTER JOIN items ON items.unique = films.ref";
I can't seem to find the way to add ORDER BY
and LIMIT
to get only the first 4 items from the films
table. The joined part is only supposed to get some further information from another table for these four items afterwards. How is it done in the right way?