I have a table named product_table as below with two fields product_id and comp_prod
The values for comp_prod will be sent as comma separated values like 4,3
but the value of product_id will be common
I want to insert the comma separated values as separate rows as follows with product_id as common. How can i do that using php and mysql ?
product_table
+-----+----------+-----------------+
| id | product_id |comp_prod |
+-----+----------+-----------------+
|1 | 339 | 4 |
|2 | 339 | 5 |
+------------+---------------------+
Hope it helps