Hey,
I will quicky give you an example of the current DB structure..
Table Rooms:
room_id
room_name
Table Online:
room_id
user_id
When a user becomes online it inserts into the Online table, when they leave they get deleted from the Online table. Is it possible to do a query such as..
select * from rooms order by sum(select * from Online where room_id=room_id) limit 30
Or is it just best to add an additional field to rooms called users_online?