Can I get a random row. with mySQL
Posted 14 September 2006 - 11:30 PM
The number is used to pick a rank number in the banners.
example: random number 1, so it picked picture.jpg (rank no. 1) from the database and plays it.
Is there a way, to just have it pick a row number.
example: SELECT * FROM database WHERE COL NUMBER IS (random number from script)
cuz the way i have it now, if i erase a banner now, the image rank is erased, so some banners might now be picked. can i get info from a row number? i hope people can understand what i'm saying...
ask questions if you don't understand...i havn't slept much this week.
Posted 14 September 2006 - 11:50 PM
Posted 15 September 2006 - 03:55 PM
SELECT * FROM $tablename ORDER BY RAND() LIMIT 1
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users