An Error Was Encountered

Error Number: 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 '' at line 1

SELECT instnm as name, addr as address, city, stabbr as state, zip, gentele as phone, webaddr as website, dd_regions.name as location, dd_calendar_types.name as calendar FROM iped_hd_o LEFT JOIN dd_regions ON obereg = dd_regions.id LEFT JOIN iped_ic_o ON iped_hd_o.unitid = iped_ic_o.unitid LEFT JOIN dd_calendar_types ON iped_ic_o.calsys = dd_calendar_types.id WHERE iped_hd_o.unitid =