1064 - 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 (payment_type = 'Offline' OR (payment_type = 'Online' AND payid!='')) order ' at line 1

select * from tbl_purchase_registration WHERE hospital_id = AND (payment_type = 'Offline' OR (payment_type = 'Online' AND payid!='')) order by id DESC

[TEP STOP]