![]() |
selecting 10 random online users (is very difficult)
i have found no simple way to do this. i'd really love to have someone come along and make me feel very, very stupid... because i have been working on this for several days without avail.
SELECT DISTINCT ... ORDER BY RAND(NOW()) does not work on any version of mysql. Code:
$loggedins2=$DB_site->query("SELECT DISTINCT session.userid,username,invisible thanks in advance for your help. :) |
hmm, normally this should work, but you can also try to save the users into an array first and then randomize the array.
|
Works fine for me on MySQL 4.0.15, you'll need to add LIMIT 10 on the end to limit it to just 10 online users though.
|
thanks guys.. i finally got it. :) i had been misled by some other information i had read about the mysql fixes for the "SELECT DISTINCT ... ORDER BY RAND()" errors for 3.23.05
|
All times are GMT. The time now is 11:16 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|