thefreebielife Posted July 19, 2007 Share Posted July 19, 2007 Ostatus in the following is always a number: <?php $result2 = mysql_query("select * from users WHERE rid=$uid && ostatus>=1"); $count2=mysql_num_rows($result2); ?> How would I get it to total all ostatus? For example, one user might have 1, another with 4, so that would be a total of 5. You have <? echo "$count2"; ?> Credits So there it would echo the total amount of ostatus. Thank You Quote Link to comment Share on other sites More sharing options...
chigley Posted July 19, 2007 Share Posted July 19, 2007 <?php $result2 = mysql_query("SELECT SUM(ostatus) FROM users WHERE rid= $uid && ostatus>=1") or die(mysql_error()); list($count2) = mysql_fetch_row($result2); echo "You have {$count2} Credits"; ?> Quote Link to comment Share on other sites More sharing options...
thefreebielife Posted July 19, 2007 Author Share Posted July 19, 2007 Haha easy enough Thanks Quote Link to comment 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.