Jump to content

Select total amount of a table


thefreebielife

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/60853-select-total-amount-of-a-table/
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.