SELECT DISTINCT m.id, concat( m.manufacturer, ' ', m.model ) AS name FROM mobiles AS m, handsets_datafiletypes AS h, datafiletypes AS d WHERE h.handset_id = m.id AND h.datafiletype_id = d.id AND d.subtype_id = '' AND h.datafiletype_id IN ( )empty( ) ORDER BY name LIMIT 0 , 30 #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 ') empty ( ) ORDER BY name LIMIT 0, 30' at line 1