Almost there:
"SELECT * FROM imgupload ORDER BY RAND() LIMIT 5"
while loop over the resultset.
I must admit, that this is slow - very slow for massive tables. Also you'd be better off naming the fields you want as opposed to using *.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
The other options are quite contrived and sometimes use more than one query. For everyday use on small tables (<1000 records - a number I plucked out of the air!), it should matter much. On bigger tables, a different approach may be req'd.
If it's solved, mark it so, with the link below the edit box.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080