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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.