I have this sample code that generates dynamic fields.
My problem is I don't know how to insert the data to the database.
I tried implode but the result is not the format I want.
implode (',', $name);
implode (',', $sweets);
implode (',', $fruits);
implode (',', $drinks);
This is my columns (id, name, sweet, fruits, drinks)
so if I generate 3 rows it should be inserted like this
ID | NAME | SWEETS | FRUITS | DRINKS
1 | mark | cake | apple | 1
2 | jenny |candy | mango | 2
3 | randy | choco | ORANGE | 3
Actually I don't know if this is possible. Thanks
FIDDLE