How can I get this array to have a row per value, e.g.
array('item1', 'item2', 'item3', 'item4');
I want them to be stored a row each seperately, not into one row.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Something like that should do it. The SQL statement construct is called “extended inserts”.
The implode() method basically glues together an array with a certain characters. See the man on it for more information.
EDIT
To appease the masses, you should run an array_filter on the array to make sure the data is properly escaped to avoid errors and sql injection: IE:
The filter portion is “untested”, just a rough example. The reason it was left out originally was the fact that no actual sql code was shown and my assumption was that the user had previously taken this into account.