Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
mmaru
Forum Newbie
Posts: 14 Joined: Tue Aug 03, 2004 10:23 pm
Post
by mmaru » Wed Aug 30, 2006 10:57 pm
I have a form with multi-line input fields that I would like to same in MySQL table (each line will be a record in the table).
The form has the following fields
Hidden id field called id
First Name called fName
Last Name called lName
The form has 10 lines - each line has a unique hidden id value. The other two fields each has the same name and value on each of the 10 lines.
When the user clicks the submit button, I would like to go throught the $_POST value and group each line in an array and save it to the MySQL table called client.
I would very much appreciate you help - this is new to me.
Regards,
Maru
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Aug 30, 2006 11:02 pm
2 ×
explode() + foreach() seems about right.
Last edited by
feyd on Wed Aug 30, 2006 11:37 pm, edited 1 time in total.
mmaru
Forum Newbie
Posts: 14 Joined: Tue Aug 03, 2004 10:23 pm
Post
by mmaru » Wed Aug 30, 2006 11:21 pm
What limit parameter do you suggest I use and how?
Regards.
Maru
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Aug 30, 2006 11:38 pm
LIMIT has nothing to do with insertions.
mmaru
Forum Newbie
Posts: 14 Joined: Tue Aug 03, 2004 10:23 pm
Post
by mmaru » Thu Aug 31, 2006 9:02 am
Sorry - I am not sure what you meant 2 × explode() + foreach() seems about right.
Correct me if I am wrong. What parameter would I pass to the first and second explode methods?
Regards,
Maru
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Aug 31, 2006 1:53 pm
Your string and a new-line/carriage-return character.
mmaru
Forum Newbie
Posts: 14 Joined: Tue Aug 03, 2004 10:23 pm
Post
by mmaru » Fri Sep 01, 2006 4:30 pm
Hi feyd,
Sorry taking you valuable time. I am totally lost. Please shade some light – may be an example or a resource I can refer.
Regards,
Maru
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Sep 01, 2006 5:05 pm
I linked to all the references you should need: the manual.