select a.termin_id, a.termin_nr, b.dag_navn, DATE_FORMAT(a.termin_dato,'%d.%m %Y') AS termin_dato, TIME_FORMAT(a.termin_tid,'%H:%i') AS termin_tid, a.termin_navn, c.arena_navn, c.arena_bilde, termin_dist_h, termin_dist_d,e.stil_navn, f.konk_type_navn, a.termin_firma, d.Firma, a.termin_info, a.termin_status, g.status_navn from termin a, dag b, arena c, firma d, stil e, konk_type f, status g where a.termin_dag=b.dag_id and a.termin_firma=d.FirmaNr and a.termin_arena=c.arena_id and a.termin_stil=e.stil_id and a.termin_konk_type=f.konk_type_id and a.termin_status=g.status_id and a.termin_id=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