Array items into different rows
Posted: Wed Dec 10, 2008 5:12 pm
Say you have a person and that person is making a shopping list
Person: Tom
Items: cake, flowers, dog food
Is it possible to write a query that would insert to the database:
row 1: tom | cake
row 2: tom | flowers
row 3: tom | dog food
Or would you have to use foreach and run a new query for each item?
Is it just better to to the array and implode it after the fact?
Person: Tom
Items: cake, flowers, dog food
Is it possible to write a query that would insert to the database:
row 1: tom | cake
row 2: tom | flowers
row 3: tom | dog food
Or would you have to use foreach and run a new query for each item?
Is it just better to to the array and implode it after the fact?