Jump to content

COUNT or SUM?


balkan7

Recommended Posts

i wanna count from client_id how many banners are active, but wrong result whit my code:

$numrows = mysql_query("SELECT client_id, COUNT(*) AS total_banners FROM ".$db_prefix."banners WHERE banner_status = '1' GROUP BY client_id");
          while ($num = mysql_fetch_assoc($numrows)){ 
echo "<td align='center' class='small'>".$num['total_banners']."</td>";
}

Link to comment
https://forums.phpfreaks.com/topic/87959-count-or-sum/
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.