Stuart Felenstein wrote:
--- Jason Wong <[EMAIL PROTECTED]> wrote:



I think will call it a day for this thread.


As I suspected a loop was needed to make this work. In the event that there are other idiots, such as
myself, that don't immediately figure out the exact
logic I'll post the code:


//The sql is Adodb syntax:
while(!$rsinds->EOF){
?>
    <option value="<?php echo
$rsinds->Fields('CareerIDs')?>"

//I could test for $inds here, doesn't seem to make a
//difference

This loop:

<?php foreach ($inds as $a) { ?> <?php if ($rsinds->Fields('CareerIDs')== $a) {echo
"SELECTED";} } ?>>

can be replaced with one in_array() function. The rest is left as an exercise to the reader ;-)


        <?php echo $rsinds->Fields('CareerCategories') ?>
</option>
 <?php
    $rsinds->MoveNext();
  }
  $rsinds->MoveFirst();

Stuart


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

Reply via email to