hi
first i explain what i want to do:
suppose that, i have 2 table: CARS (that keep cars infos) & CAR_REPAIRS (keep explaination of repairments done on the car).
always , when i add car infos to `CARS` table, i have a repair case that must add to CAR_REPAIRS table. so i need a car_id in CARS table for adding a record in CAR_REPAIRS table.
now in case that i want to add multi records to cars table, i need multi car_id for insert repairments to CAR_REPAIRS table.
now i want to know best way that i can insert these records:
is there anyway for joinin tables in INSERT statement?
or i must take the mysql_insert_id and rewrite a INSERT statement for insertin to CAR_REPAIRS table after run this query:
Code:
INSERT INTO `cars`
(car_model,car_plaque,car_produce_date)
VALUES
(1,'11A111',2001),
(1,'11A111',2002),
(1,'11A111',2003)