MYSQL ERROR : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND cit.cityStatus = 'Active' ) GROUP BY' at line 104
Query : SELECT deal.dealID, deal.dealTypeID, deal.dealKey, deal.dealEndTime, IF( (CONVERT_TZ(NOW(),@@session.time_zone,timez.timeZoneDiff)>0), CONVERT_TZ(NOW(),@@session.time_zone,timez.timeZoneDiff), NOW() ) AS timeZoneConverted, deal.dealCommissionRate, deal.dealServiceFee, deal.dealMinBuyLimit, deal.dealMaxBuyLimit, deal.dealMaxGiftBuy, deal.dealTippedDate, deal.dealDefaultCurrency, deal.dealImage, dealDet.dealTitle, 'product_deal' AS dealTypeKey, bus.businessKey, ( SELECT COUNT(dealOptionID) FROM dp_deal_options WHERE dealID = deal.dealID AND dealOptionStatus = 'Active' ) AS dealOptionCount, dealOpt.dealOptionID, dealOpt.dealOptionDealPrice, dealOpt.dealOptionRegularPrice, dealOpt.dealOptionQuantity, dealOpt.dealQuantityUnlimited, ( SELECT SUM(CAST(dealQuantityUnlimited AS UNSIGNED))+SUM(CAST(dealOptionQuantity AS UNSIGNED)) AS dealOptionQuantityQuantitySum FROM dp_deal_options WHERE dealID = deal.dealID AND dealOptionStatus = 'Active' ) AS dealOptionQuantitySum FROM dp_deals AS deal LEFT JOIN dp_deal_details AS dealDet ON ( deal.dealID = dealDet.dealID AND dealDet.languageID = 1 ) LEFT JOIN dp_business AS bus ON ( deal.businessID = bus.businessID AND bus.businessStatus = 'Active' ) LEFT JOIN dp_deal_options AS dealOpt ON ( deal.dealID = dealOpt.dealID AND dealOpt.dealOptionDefault = 'Yes' AND dealOpt.dealOptionStatus = 'Active' ) LEFT JOIN dp_timezones AS timez ON deal.dealTimeZone = timez.timeZoneID WHERE deal.dealID IN(421,527) AND deal.dealStatus='Active' AND ( CONVERT_TZ(NOW(),@@session.time_zone,timez.timeZoneDiff) BETWEEN deal.dealStartTime AND deal.dealEndTime ) AND ( (CONVERT_TZ(NOW(),@@session.time_zone,timez.timeZoneDiff) < deal.dealExpiryDate) OR (deal.dealExpiryDate='0000-00-00 00:00:00') ) AND EXISTS( SELECT 1 FROM dp_deal_locations AS dealLoc LEFT JOIN dp_cities AS cit ON dealLoc.cityID = cit.cityID WHERE dealLoc.dealID = deal.dealID AND dealLoc.cityID = AND cit.cityStatus = 'Active' ) GROUP BY deal.dealID ORDER BY deal.dealStartTime

Give a Travel Factory
Gift Card

Ideal present for all travellers.

Buy now


Selected Deal is passed/not active.