Page 1 of 1

PHP Multi-line input form and MySQL

Posted: Wed Aug 30, 2006 10:57 pm
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

Posted: Wed Aug 30, 2006 11:02 pm
by feyd
2 × explode() + foreach() seems about right.

Posted: Wed Aug 30, 2006 11:21 pm
by mmaru
What limit parameter do you suggest I use and how?

Regards.

Maru

Posted: Wed Aug 30, 2006 11:38 pm
by feyd
LIMIT has nothing to do with insertions.

Posted: Thu Aug 31, 2006 9:02 am
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

Posted: Thu Aug 31, 2006 1:53 pm
by feyd
Your string and a new-line/carriage-return character.

Posted: Fri Sep 01, 2006 4:30 pm
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

Posted: Fri Sep 01, 2006 5:05 pm
by feyd
I linked to all the references you should need: the manual.