Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT c.*, count(a.post_id) as item_count
- FROM tbl_category c
- LEFT JOIN tbl_postad a on a.post_maincategory = c.cat_id
- WHERE c.cat_parent=0 AND c.cat_promote = 0
- AND c.selActive = 'Y' AND a.post_delete_status!='Y' AND a.post_cat_status!='N'
- AND a.post_status='Y' AND a.block=0 AND a.post_expiredate >= '".date("Y-m-d H:i:s")."'
- GROUP BY c.cat_name
- ORDER BY c.cat_sort asc
- SELECT c.*, count(a.post_id) as item_count
- FROM tbl_category c
- LEFT JOIN tbl_postad a on a.post_maincategory=c.cat_id
- WHERE c.cat_parent=0 AND c.cat_promote = 0 AND c.selActive = 'Y'
- GROUP BY c.cat_name
- ORDER BY c.cat_sort asc
- select c.*, count(a.post_id) as item_count
- from tbl_category c left join
- tbl_postad a
- on a.post_maincategory = c.cat_id and
- a.post_delete_status <> 'Y' and
- a.post_status = 'Y' and
- a.post_cat_status <> 'N' and
- a.block = 0 and
- a.post_expiredate >= '".date("Y-m-d H:i:s")."'
- where c.cat_parent = 0 and
- c.cat_promote = 0 and
- c.selActive = 'Y' ;
Add Comment
Please, Sign In to add comment