Alrighty, I've rewritten this query about 500 times. I'm getting nowhere. Here's the mysql query:
$result=mysql_query("SELECT *, MD5( RAND( NOW( ) ) ) AS myRandom FROM records WHERE recordsID BETWEEN '900' AND '920' ORDER BY myRandom LIMIT 0,4") or die ("No results found.");
Let me explain what I am trying to do:
I want to take the last 20 records in my database and then only display 4 of them at a time, but display them randomly.
I am only able to accomplish this with the above query if I hardcode the last row's ID (920)and the ID of the row 20 before it (900).
Is there a way I can replace the "920" with a the last row ID dynamically and then calculate like last row id - 20 to get the other number? Am I making sense?
Thanks