$query = "insert into inspectionunit(inspectionunitid,inspectionunitname) select '$inspectionunitid','$unitname' from (select 1) tmp where not exists (select 1 from inspectionunit where inspectionunitname='$unitname')";