Using LIMIT statements in MySQL
To get the front page images, I used a LIMIT function in SQL. something like this:
SELECT * FROM places ORDER BY add_date DESC LIMIT 0,6
And use these results to query the database again and grab the main photo details.
Easy, I thought. They I realised that sometimes a place doesn’t have a photo to go along [...]