An error occurred: select ct.type_id,ct.coupontype,ct.IconClass,ct.FilterType,ct.BadgeClass,count(1) as totalcount
FROM coupons c
inner join coupon_type ct on ct.type_id = c.coupon_type
where c.store_id =
and (IFNULL(exp_date,CURDATE()) >= CURDATE() or exp_date = '0000-00-00')
group by ct.type_id,ct.coupontype,ct.IconClass,ct.FilterType,ct.BadgeClass
order by ct.type_id
-- An error occurred: SELECT coupon_id, coupon_title, coupon_desc, coupon_detail, coupon_code, coupon_type, discount_type, discount_value, verified, used_total, exp_date, rank, positive_vote, negative_vote, added_date, edited_date
,(select coupontype from coupon_type where type_id = c.coupon_type) as coupontype
,(select discounttype from discount_type where type_id = c.discount_type) as discounttype
FROM coupons c
where c.store_id =
and c.statusid = 2
and (IFNULL(exp_date,CURDATE()) >= CURDATE() or exp_date = '0000-00-00')
order by rank
--