1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

insert data into database without duplicates

Discussion in 'Meet and Greet' started by mpho marumo, Apr 26, 2011.

  1. mpho marumo

    mpho marumo New Member

    Joined:
    Apr 26, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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,rjbFstName,rjbSurname,rjbTelNr1Number,rjbSubName,rjbTelNr4Number,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,rjbTelNr4Number,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)
     

Share This Page