I'm creating some multiple selection list boxes. 

I believe this would be close to the correct code to
pull the selections:

  <select name="select" size="3" multiple="multiple">
    <?php $arrayselect = explode(" ", "Please
Select"); ?>
    <option value="NY" <?php for ($i=0;
$i<sizeof($arrayselect); $i++) {if ("NY" ==
$arrayselect[$i]) {echo "selected"; break;}}?>>New
    <option value="SF" <?php for ($i=0;
$i<sizeof($arrayselect); $i++) {if ("SF" ==
$arrayselect[$i]) {echo "selected"; break;}}?>>San
    <option value="LA" <?php for ($i=0;
$i<sizeof($arrayselect); $i++) {if ("LA" ==
$arrayselect[$i]) {echo "selected"; break;}}?>>Los
    <option value="DC" <?php for ($i=0;
$i<sizeof($arrayselect); $i++) {if ("DC" ==
$arrayselect[$i]) {echo "selected";
break;}}?>>Washington D.C.</option>

The values from the table are stores by valueID and
Label.  Not sure if I need some kind of delimiter in
my code ?

Also, what is the most effective way to store the
selections in the database ? I'm assuming it would be
an "enum" column.   


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to