View Full Version : mysql counting rows

10-18-2011, 03:08 PM
I want to count the the cows that has a 1 in it the ones with 0 i want to ignore. am I on the right track?

$strQuery333 = "SELECT COUNT(*) AS counting "
." FROM auto_pings "
." WHERE partner_id_buyer = '$ors[partner_id_buyer]_ping_success' "
." AND MONTH(date_day)=MONTH(NOW())";
$result333 = mysql_query($strQuery333) or die(mysql_error());
$ors333 = mysql_fetch_array($result333);

echo "<div class=\"FLeft Ping\">Ping: $ors333[counting]</div>"

10-18-2011, 03:19 PM
It's MySql forum. Please post your table schema with some sample data and the query that you plan to execute (not the PHP code).