Invalid SQL: select *,items.id as tid, prices.id as priceID from exceltiles_items as items left join exceltiles_items_customer_prices as prices on (prices.itemID=items.id AND prices.customerID='0' AND prices.customerID>0) where items.active=1 and (prices.activeItem IS NULL OR prices.activeItem=1) and (catID in (518,526,516,610,542,543,541,540,584,581,583,585,595,582,607,608,606,609,605,580,598,614,602,600,601,599,611,586,593,591,592,579,603,538,539,533,517,519,532,547,545,546,548,520,562,574,572,570,573,575,577,578,571,597,604,567,566,568,569,527,555,556,557,558,559,564,565,560,561,563,596,549,505,506,507,508,529,513,514,515,552,530,550,551,521,525,524,522,523,534,536,537,535) or catID2 in (518,526,516,610,542,543,541,540,584,581,583,585,595,582,607,608,606,609,605,580,598,614,602,600,601,599,611,586,593,591,592,579,603,538,539,533,517,519,532,547,545,546,548,520,562,574,572,570,573,575,577,578,571,597,604,567,566,568,569,527,555,556,557,558,559,564,565,560,561,563,596,549,505,506,507,508,529,513,514,515,552,530,550,551,521,525,524,522,523,534,536,537,535)) and (amazonItem!=1) and activeOnWebsite=1 and wholesaleItem=1 and (catID= or catID2= or items.catID in (550) or items.catID2 in (550) ) order by (items.price+0) asc LIMIT 0, 52