[PHP + MySQL] Users Online, Members Online, and MySQL Login

Joined
Dec 4, 2007
Messages
1,935
Reaction score
96
Okay, so here, I need help with 3 different things.

1) I want a code to display how many guests are viewing the homepage or whole site entirely. (I'll put those code on homepage)

2) I want a code to display how many members are logged onto the MySQL Database.

3) I want a MySQL login to add to my site, so people login to the forum on the homepage. And when logged in, it must say "Wecome, Username!"

Can anyone help?

Also, in the code, where I have to enter the MySQL details, please display like "MySQL User", "MySQL Pass", MySQL DB" in the code, so I know where to place MySQL information.
 
I think you just need help with MySQL-queries.
For 1:
PHP:
$q = "SELECT COUNT(*) FROM sessions WHERE user_logged = 0";

For 2:
Same like no.1 but with user_logged = 1.

For 3:
For bridge authorizations you must know how your forum stores passwords. In vBulletin its md5(md5($password)) as i think, in IPB - md5($password + $salt);
 
Back