DeathStar Posted March 14, 2007 Share Posted March 14, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/42699-solved-sql-count-problem/ Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 $listcount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE laston >UNIX_TIMESTAMP() - 3600",$c)); $listcount = $listcount[0]; --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42699-solved-sql-count-problem/#findComment-207176 Share on other sites More sharing options...
DeathStar Posted March 14, 2007 Author Share Posted March 14, 2007 That works thanks Quote Link to comment https://forums.phpfreaks.com/topic/42699-solved-sql-count-problem/#findComment-207185 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.