商品归属省份统计,下面代码优化
$arrCountP1= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =1 " ); $arrCountP2= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =2 " ); $arrCountP3= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =3 " ); $arrCountP4= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =4 " ); $arrCountP5= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =5 " ); $arrCountP6= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =6 " ); $arrCountP7= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =7 " ); $arrCountP8= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =8 " ); $arrCountP9= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =9 " ); $arrCountP10= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =10 " ); $arrCountP11= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =11 " ); $arrCountP12= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =12 " ); $arrCountP13= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =13 " ); $arrCountP14= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =14 " ); $arrCountP15= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =15 " ); $arrCountP16= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =16 " ); $arrCountP17= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =17 " ); $arrCountP18= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =18 " ); $arrCountP19= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =19 " ); $arrCountP20= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =20 " ); $arrCountP21= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =21 " ); $arrCountP22= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =22 " ); $arrCountP23= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =23 " ); $arrCountP24= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =24 " ); $arrCountP25= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =25 " ); $arrCountP26= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =26 " ); $arrCountP27= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =27 " ); $arrCountP28= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =28 " ); $arrCountP29= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =29 " ); $arrCountP30= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =30 " ); $arrCountP31= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =31 " ); $arrCountP32= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =32 " ); $arrCountP33= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =33 " ); $arrCountP34= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =34 " ); $arrCountP35= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =35 " ); $arrCountP36= db_factory::get_count ( "select count(*) from " . TABLEPRE . "service where cat = '$ky' and province =36 " );