Incorrect DATETIME value: ''
select discount_percentage, discount_start_date, discount_expire_date from tbl_category, tbl_category_item_map where tbl_category.category_id = tbl_category_item_map.category_id and (discount_start_date <= now() or discount_start_date is NULL or discount_start_date = '') and (discount_expire_date > now() or discount_expire_date is NULL or discount_expire_date = '') and item_id = 165 order by discount_percentage DESC limit 0,1