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 modelid=''' at line 1SELECT min(minYear) as start_year, max(maxYear) as end_year FROM WHERE modelid=''