I am working on a PHP project in which a mysql table needs to be updated with lots of rows in a single update.
A set of parameters will be assigned for a product.
Please find my present steps below:
1. Delete all rows with the product_id in the table
2. Insert data into it. (Say 10no of rows)
I am looking forward to have the following setup
1. Create a temporary table.
2. Insert data into the temp table.
3. Update the original table
Which method do you think is better? Which one uses less resource?