I used the php time() function until I realised how impractical that was for queries. Use MySQL very simple date and/or time types and you\'ll have a wider range of queries. I don\'t know what the php time returned, but because it\'s a varchar type, it may not order properly.
Also, if you want to return the last 6 rows, my little SQL would count all the rows, get count -6, and query would look
limit 35,40
which will return row 35 till 40 if you have 40 rows in your query.