Hi,
Im having a wierd problem with my mysql query:
I have entries in my database with a rating (out of 10) and a timestamp, and I want to pull out the highest rated entry from the past 30 days. These are the entries I have:
Primary key ----------------- Rating ------------------ Timestamp
1 3 979818943
2 6 1232277417
3 9 2147483647
4 10 1232811754
This is my query:
$SecondsInOneMonth = 2629743;
$time = time() - $SecondsInOneMonth;
$result = mysql_query('SELECT * FROM images WHERE `timestamp` > "'.$time.'" ORDER BY ratingav DESC LIMIT 1');
The result from the query pulls out the item with primary key 3.
Any reason why?
Thanks in advance.
Max Mumford.