I am trying get the total count from multiple fields in the same table. The count total for each field will be different.
$tmp = mysql_query("SELECT cat1, cat2, cat3, cat4, cat5, cat6 FROM pro_store");
$row = mysql_fetch_array($tmp);
$art = count ($row['cat1']);
$auto = count ($row['cat2']);
$bling = count ($row['cat3']);
$clothing = count ($row['cat4']);
$clubs = count ($row['cat5']);
$computers = count ($row['cat6']);
And it returns
Art: 2
Auto: 2
Bling: 2 ... and so on.
There may not be anything in the Art (cat1) field, but it returns the total row count, not an individual category count.
I need to count fields individually that contain a variable, not a total row count.