select *,filedetail.adftype as adftype, as id,datatype.shortdesc as class_short,datatype.longdesc as class_long,subtype.shortdesc as sub_short, subtype.longdesc as sub_long from filedetail left join datatype on left join switches on left join subtype on left join limits on left join ion on where : 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