|
Posted by J.O. Aho on 12/29/06 08:03
Ace wrote:
> Dear all
>
> I have use DW making a PHP site and has set a multiple selection
> field..But I don't know how to write the SQL statement to database like
>
> <select name="support[]" size="3" multiple="multiple" id="support">
> <option value="1">Apple</option>
> <option value="2">Orange</option>
> <option value="3">Banana</option>
> <option value="4">Watermelon</option>
> </select>
>
> If I choose 1 & 4, my database table will capture to array..I want the
> DB can be caapture the 1,4, please teach me how to do this.(I know
> array is a vars but i don't know how to write the statement)
Much depends on how you want to store the data
One line, comma between entries:
$theline=implode(',',$_REQUEST['support']);
Do something for each entry:
for($i=0;$i<count($_REQUEST['support']);$i++) {
$currentvalue=$_REQUEST['support'][$i];
/* do what you want with the $currentvalue */
}
> BTW..If I would like recall this field to display. how to do it
The above for loop.
--
//Aho
Navigation:
[Reply to this message]
|