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 lots.published = '1' AND ((low_estimate BETWEEN '0' AND '130000') OR ' at line 3 SQL=SELECT lots.lot_id,lots.lot_name,lots.estimate,lots.description,lots.soldstatus,lots.sales_price,lots.unique_id, lots.condition_report,lots.archieved,lots.nlot_number as lot_number,lots.lot_number as nlot_number, lots.lot_numeric,lots.auction_catalog_id,lots.published,lots.low_estimate,lots.high_estimate,lots.hammer_price,lots.withdraw_lot,lots.buy_back,lots.pawnbroker,lots.excluding_vat,lots.has_box,lots.has_papers, lots.export_issue,lots.facebook, lots.arr FROM jos_lots as lots WHERE lot_number != 0 AND lots.auction_catalog_id= AND lots.published = '1' AND ((low_estimate BETWEEN '0' AND '130000') OR (high_estimate BETWEEN '0' AND '130000')) GROUP BY lots.lot_id ORDER BY nlot_number ASC LIMIT 0, 25




