I have 2 tables that look like this.(see below). Table one is named tableX and table 2 is named tableY.
+-------+---------+
| count | post_id |
+-------+---------+
| 3 | 7209 |
| 3 | 7210 |
| 1 | 7211 |
| 1 | 7212 |
| 1 | 7213 |
| 1 | 7215 |
+-------+---------+
+---------+---------+------------+------------+
| meta_id | post_id | meta_key | meta_value |
+---------+---------+------------+------------+
| 32 | 7209 | multiple | 3 |
| 33 | 7209 | multiple_0 | 27 |
| 34 | 7209 | multiple_0 | 34 |
| 35 | 7209 | multiple_0 | 1 |
| 36 | 7210 | multiple | 3 |
| 37 | 7210 | multiple_0 | 11 |
| 38 | 7210 | multiple_0 | 37 |
| 39 | 7210 | multiple_0 | 51 |
| 40 | 7211 | multiple | 1 |
| 41 | 7211 | multiple_0 | 36 |
| 42 | 7212 | multiple | 1 |
| 43 | 7212 | multiple_0 | 11 |
| 44 | 7213 | multiple | 1 |
| 45 | 7213 | multiple_0 | 15 |
| 46 | 7215 | multiple | 1 |
| 47 | 7215 | multiple_0 | 42 |
+---------+---------+------------+------------+
I am looking for suggestions on how i can change values in the field "meta_key" so that tableY looks like the table below whereby multiple auto_increments with values 0 to nth number depending on the count of post_id using php
+---------+---------+------------+------------+
| meta_id | post_id | meta_key | meta_value |
+---------+---------+------------+------------+
| 1 | 7209 | multiple | 3 |
| 2 | 7209 | multiple_0 | 27 |
| 3 | 7209 | multiple_1 | 34 |
| 4 | 7209 | multiple_2 | 1 |
| 5 | 7210 | multiple | 3 |
| 6 | 7210 | multiple_0 | 51 |
| 7 | 7210 | multiple_1 | 11 |
| 8 | 7210 | multiple_2 | 37 |
| 9 | 7211 | multiple | 1 |
| 10 | 7211 | multiple_0 | 36 |
| 11 | 7212 | multiple | 1 |
| 12 | 7212 | multiple_0 | 11 |
| 13 | 7213 | multiple | 1 |
| 14 | 7213 | multiple_0 | 15 |
| 15 | 7215 | multiple | 1 |
| 16 | 7215 | multiple_0 | 42 |
+---------+---------+------------+------------+