Orionsbelter Posted August 23, 2009 Share Posted August 23, 2009 $time=time(); $winner=mysql_query("SELECT username, online FROM user_info WHERE online > '$time' ORDER BY RAND() LIMIT 1"); it doesn't randomly pick anyone Link to comment https://forums.phpfreaks.com/topic/171513-php-mysql-rand-string-not-working/ Share on other sites More sharing options...
kayess2004 Posted August 23, 2009 Share Posted August 23, 2009 If you use time() this gives you the current time. So each time you run the query noone can actually be considered online after now. Try giving it a timespan of say now - 1 hour or something like that. Link to comment https://forums.phpfreaks.com/topic/171513-php-mysql-rand-string-not-working/#findComment-904459 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.