select cat from directory where is_archived=0 and site_url != '' and (city='richland' OR city='richland') and (state='KS' OR state='Kansas')
select cat from directory where is_archived=0 and site_url != '' and (city='richland' OR city='richland') and (state='KS' OR state='Kansas')
union
select cat from affiliate_directory where is_archived=0 and site_url != '' and (FIND_IN_SET('richland', city) OR city='all' ) and (state='KS' OR state='Kansas' OR state='all')
56,1
select id,category_name,cat_img,catslug from directory_category where is_archived=0 and category_type='1' and id IN (56,197,181,227,66,168,119,80,1,163,867,1224,791,107) ORDER BY `catorder` ASC Limit 0,2
(select id,site_url,local_address,com_name, COUNT(site_url) as com_num from directory
where is_archived=0 and site_url != '' and (city='bartlett' OR city='bartlett') and (state='IL' OR state='Illinois') and cat='791' and sub_cat='1231' and (sub_sub IS NULL OR sub_sub=0 )
Group by site_url order by com_name asc limit 0,100)
union
(select id,site_url,local_address,affiliate_name as com_name, COUNT(site_url) as com_num from affiliate_directory
where is_archived=0 and site_url != '' and (FIND_IN_SET('bartlett', city) OR city='all' ) and (state='IL' OR state='Illinois' OR state='all') and cat='791' and sub_cat='1231' and (sub_sub IS NULL OR sub_sub=0 )
GROUP BY site_url order by com_name asc)
(select id,site_url,local_address,com_name, COUNT(site_url) as com_num from directory
where is_archived=0 and site_url != '' and (city='bartlett' OR city='bartlett') and (state='IL' OR state='Illinois') and cat='1224' and sub_cat='1225' and (sub_sub IS NULL OR sub_sub=0 )
Group by site_url order by com_name asc limit 0,100)
union
(select id,site_url,local_address,affiliate_name as com_name, COUNT(site_url) as com_num from affiliate_directory
where is_archived=0 and site_url != '' and (FIND_IN_SET('bartlett', city) OR city='all' ) and (state='IL' OR state='Illinois' OR state='all') and cat='1224' and sub_cat='1225' and (sub_sub IS NULL OR sub_sub=0 )
GROUP BY site_url order by com_name asc)