MySQL Forums
Forum List  »  PHP

Multiple-value form fields: via PHP to mySQL
Posted by: harri.saarikoski
Date: June 01, 2005 03:47AM

Hello

In HTML form I have select constructs some of which can have multiple values.
I would want to feed those to mySQL database.

For example, if I have two multiple-value fields (classifiertype and trainingsource)
with two possible values each, and if all of them get selected by the user,
I need to insert 4 records (2x2) to store in the database.

All those permutations should be retrievable via system name field (mysysname, singular value).
I do not mind having several records (rows) for one system,
just as long as the query for mysysname returns all the permutations.

I do not know how to do this precisely.

This is the HTML side of it:

<input name="mysysname" type="text" size="20">My system name</input>

<select multiple="multiple" name="classifiertype[]">
<option value="bayes">
<option value="timbl">
...
</select>
<select multiple="multiple" name="trainingsource[]">
<option value="browncorpus">
<option value="wallstreetjournal">
...
</select>

This is about machine-learning systems (named say "harris") attempts to learn patterns from text.
To do that it needs to have multiple classifiers (bayes and timbl) but can still train itself on one or more text collections (brown, wsj), textual features etc.

I would have a table like this in mySQL to receive the form data:
- mysysname
- classifiertype
- trainingsource
...

But how should I carry out the mySQL insert permutations using PHP?
(Or is there possibly another way?)

best wishes,
Harri S

Options: ReplyQuote


Subject
Written By
Posted
Multiple-value form fields: via PHP to mySQL
June 01, 2005 03:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.