I have some checkboxes on a form.

Now I figured out how to store them in a database sandwiched together (like
thing1,thing2,thing3,thing4).

However, what is the best method for storing them each in an individual
field.

This is what I'd really like:

| userid | otherthing |
|    1     |    azu       |
|    1     |    cde       |
|    1     |    foo        |
|    2     |    bar        |

Would it be something like:

Count the number of things, then do

for($x = 0, $x <= $numberofthings; $x++) {

    $sql = "INSERT INTO table (userid, otherthing) VALUES ('$userid',
'$things[$x]')";

    $result = mysql_query($sql);

    if (!$result) { blaherrorchecking(); }

}

What do you all think of that?  Is it a good solution?  Lousy?  A hack job?
Is there a better way?

- k


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to