Re: [SOLVED] Question: Repopulating form parameters
| From: | Stuart Felenstein | Date: | Mon, 13 Dec 2004 12:23:49 +0000 |
| Subject: | Re: [SOLVED] Question: Repopulating form parameters | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204157@lists.php.net to get a copy of this message | ||
--- Jason Wong <php-general@gremlins.biz> 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
<?php foreach ($inds as $a) { ?>
<?php if ($rsinds->Fields('CareerIDs')== $a) {echo
"SELECTED";} } ?>>
<?php echo $rsinds->Fields('CareerCategories') ?>
</option>
<?php
$rsinds->MoveNext();
}
$rsinds->MoveFirst();
Stuart