Re: [SOLVED] Question: Repopulating form parameters
| From: | Marek Kilimajer | Date: | Mon, 13 Dec 2004 12:57:08 +0000 |
| Subject: | Re: [SOLVED] Question: Repopulating form parameters | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204159@lists.php.net to get a copy of this message | ||
Stuart Felenstein wrote:
--- Jason Wong <php-general@gremlins.biz> wrote:This loop: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";} } ?>>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