PHP Multi-line input form and MySQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mmaru
Forum Newbie
Posts: 14
Joined: Tue Aug 03, 2004 10:23 pm

PHP Multi-line input form and MySQL

Post by mmaru »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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 »

What limit parameter do you suggest I use and how?

Regards.

Maru
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

LIMIT has nothing to do with insertions.
mmaru
Forum Newbie
Posts: 14
Joined: Tue Aug 03, 2004 10:23 pm

Post by mmaru »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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 »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I linked to all the references you should need: the manual.
Post Reply