I'm trying to create a script so that it checks whether there is a duplicate of, say for example a type of car. It would check the make and type of car (volvo 260, volvo) from the database, then if it exists the user is allowed to change the speed etc. of the car. I've got this so far:
INSERT INTO cars (id, car_id, car_name, car_make car_speed, car_passengers)
VALUES (1, 1, 'volvo', 'S60', 150, 4)
ON DUPLICATE KEY UPDATE car_speed=VALUES(speed);
I would also like it to check the car name as well as the car make. Is that possible to do?