PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
That's the point I don't understand. Why do you want to check the database at a pre-defined interval? I see no reason to do that.
To know current online users.
You could just make it so the only time that you check is when the user actually asks instead of wasting everyone's (including your) bandwidth. The only time it'd need to be live is if you made a chat room.