My Blog of Japan Japan!

Posts Tagged MySQL

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 [...]


Programming zoom levels and fitting points

Last week I started adding content to the front page. In PHP, I programmed a script to pull the latest 6 places from the database, grab their main photo and display it with a link to the page. I also grabbed the coordinates for each place and put them all on a map. The general [...]