I finding trouble deciding what is the fastest way to count some specifc records from my tables filtered by a where statment here is my code, here are the queries:
$type_mo3ln_malk = mysql_num_rows(mysql_query("SELECT * FROM `tableshow` $weress AND mo3ln_type='malk'"));
$type_mo3ln_mswg = mysql_num_rows(mysql_query("SELECT * FROM `tableshow` $weress AND mo3ln_type='mswg'"));
$type_mo3ln_mktb = mysql_num_rows(mysql_query("SELECT * FROM `tableshow` $weress AND mo3ln_type='mktb'"));
$type_mo3ln_wkeel = mysql_num_rows(mysql_query("SELECT * FROM `tableshow` $weress AND mo3ln_type='wkeel'"));
$type_mo3ln_no = mysql_num_rows(mysql_query("SELECT * FROM `tableshow` $weress AND mo3ln_type='0'"));
the function that do the count are the one which is predefined in php
I am thinking of using count() function but I am wondering if I could use Sum function for some specific rows only as Mr.Hates suggested here Get record counts for all tables in MySQL database