Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Meet and Greet (http://www.go4expert.com/community/meet-and-greet/)
-   -   insert data into database without duplicates (http://www.go4expert.com/community/insert-data-database-duplicates-t25629/)

mpho marumo 26Apr2011 12:54

insert data into database without duplicates
 
I have reached the brick wall, been trying to write code to insert data into database without repeating "already" the inserted row
here is what I have
INSERT INTO roshcon_vehicle_v1_0 VALUES (VehicleRegNumber,VehicleType,VehicleMake,rjbFstNa me,rjbSurname,rjbTelNr1Number,rjbSubName,rjbTelNr4 Number,rjbSubManagerEmail,Hire_Time) ON DUPLICATE KEY UPDATE VehicleRegNumber = '$VehicleRegNumber', SELECT roshcon_vehicle_report_001.VehicleRegNumber, VehicleType,VehicleMake, roshcon_vehicle_drivers_v1_0.rjbFstName, rjbSurname,rjbTelNr1Number,rjbSubName,rjbTelNr4Num ber,rjbSubManagerEmail, Hire_Time FROM roshcon_vehicle_driver_v1_0, roshcon_vehicle_report_001, roshcon_vehicle_drivers_v1_0 WHERE roshcon_vehicle_report_001.VehicleId = roshcon_vehicle_driver_v1_0.Id AND roshcon_vehicle_drivers_v1_0.rjbId = roshcon_vehicle_driver_v1_0.rjbFstName

I get (Error: 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 'SELECT roshcon_vehicle_report_001.VehicleRegNumber, VehicleType,VehicleMake, ros' at line 4)


All times are GMT +5.5. The time now is 04:41.