我正在尝试从Mysql加载多个类别,这段代码可以改进吗?
> $category='';
$search_for_categories_on_service = mysql_query("SELECT * FROM service WHERE mid='$m_id' AND online='1'");
while($cat_search_row = mysql_fetch_array($search_for_categories_on_service)){
$search_cat_query = $cat_search_row['category'];
$category .=" OR category LIKE '%$search_cat_query%' ";
}
$construct = mysql_query("SELECT * FROM request_service WHERE id AND category = 'none' $category AND online='1'");