Forum Moderators: coopster

Message Too Old, No Replies

Text Area Multiple Values - SQL Insertion

How to insert multiple values in DB line by line......

         

fastfriend

1:24 pm on Feb 22, 2006 (gmt 0)

10+ Year Member



I have a form, where I want to submit sub-categories into Main Category e.g.

AAA (Main Category)
-aa1
-aa2
-aa3
-aa4
-aa5

One option is that I insert sub-categories 1 by 1. Its OK but what I do if I have 100s of sub-categories for AAA.

What I want to do is, in the FORM, in TEXT AREA, I write all sub-categories line by line say

aa1
aa2
aa3
aa4
aa5

When I click SUBMIT, the action file takes line by line value and insert into a DB as aa1 is single row and so on..........so each sub-category take a SINGLE ROW in a DB.

Thanks for the HELP in advance.

whoisgregg

3:48 pm on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the script that processes that input, first explode [php.net] the textarea on the line breaks, then loop [us2.php.net] through the resulting array and insert each line separately.