I have below tables while adding the product
- product_table [contains basic details like pid, name, rate, height, width]
- product_sellers [contains param like seller details]
- product_offers [contains offers on products]
and so on 5 tables. There are total 8 tables and all the tables are linked through pid
as foreign key.
I know below three approaches:
Using Insert statement one by one on all tables
$sql = "table 1 insert"; $sq2 = "table 2 insert";
- make functions of all tables and call them one by one.
Using BEGIN and COMMIT statements.
BEGIN $sql = "table 1 insert"; $sq2 = "table 2 insert"; COMMIT
Is there any better approach and out of above 3 which approach is faster and proficient?