Posted by David Robinson on 03/19/05 11:12
"Tex John" <john@logontexas.com> wrote in message
news:qaF_d.2230$ot.1745@tornado.texas.rr.com...
>
> <select name="test[]" multiple="multiple">
> <option value="one">one</option>
> <option value="two">two</option>
> <option value="three">three</option>
> <option value="four">four</option>
> <option value="five">five</option>
> </select>
>
>
> $query = "INSERT INTO database SET ";
> for ($x = 0; $x < count($test); $x++) {
> $query .= "column = '".$test[$x]."'";
> if($x < (count($test) + 1)) $query .= ", ";
> }
> $query .= "WHERE foo = 'bar'";
>
> You mean like that?
>
> John
>
Don't forget to add a space between columns:
.....
$query .= "column = '".$test[$x]." '";
....
[Back to original message]
|