Welcome Guest, Not a member yet? Register   Sign In
Selecting a random result that changes each time the page refreshes
#2

[eluser]CroNiX[/eluser]
There is no efficient way to do this in mysql AFAIK. From what I've read, the best way is to select MAX(id) in one query, then use php to get a random number between 1 and that number and then do a 2nd query to get the record. However, that assumes no rows have been deleted.


Messages In This Thread
Selecting a random result that changes each time the page refreshes - by El Forum - 02-01-2012, 09:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB