I need the same solution for my database.
I m trying do do a loop in a table named "truck_technical_detail" until last record and for each record I want to take "gearboxes" data value (which is seperated by " - "), explode it and for each gearbox in it I want to check if it is already exixts in "truck_gearboxes" table. If it is not I want to add it and check next exploded gearbox value.
Could you please advice me a code by using mysql PDO.