Jump to content

[SOLVED] SQL COUNT(*) Problem


DeathStar

Recommended Posts

Hi

I have a problem:

I want to display How many users are online

ex. 5 of 100 users are Online

 

THis is what im using:

$cnt        = mysql_query("SELECT userid FROM users", $c);
$membs      = mysql_num_rows($cnt);
$listcount = mysql_query("SELECT COUNT(*) FROM users WHERE laston >UNIX_TIMESTAMP() - 3600",$c);
print "<center><i>$listcount</i> of <i>$membs</i> Are online. </center>";

 

What am i doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/42699-solved-sql-count-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.