Jump to content

[SOLVED] Need help with PHP/MySQL count


SocomNegotiator

Recommended Posts

Well I am trying to count all of one field in a table. There could be 50 or more rows with different credit amounts...well I want the sum of all of them together. I know this is probably pretty basic, but I can't figure it out.

 

Here's what I have:

$credit_total=mysql_query("SELECT COUNT(credit_amount) FROM credits");
$row = mysql_fetch_assoc($credit_total);
$row['COUNT(credit_amount)']  = $count;

 

Now $count for some reason is just showing up as nothing

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/102089-solved-need-help-with-phpmysql-count/
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.