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 'WHERE mm_id='' AND bv_year='hyundai'' at line 1SELECT DISTINCT(sm_id) FROM WHERE mm_id='' AND bv_year='hyundai'