Re: Update multiple records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- Jochem Maas <jochem@xxxxxxxxxxxxx> wrote:

> don't be sorry, be pro-active and rewrite it until
> its idiot proof. its 
> in your own best interest - the clearer you state
> your problem the 
> greater the chance someone will/can help you.
> 

Well I've started with a clean slate.  Meaning I
ditched what was starting to look like spaghetti and
started over with a lot of print_r's.  

My select statement in the (intended)update page has 3
parameters in the where statement, that are passed
over from the link using $GET_VARS.  1- is the
recordID, 2-the userID 3-an encrypted code tied to the
user.
All those parameters show up fine (print_r) on said
update page.

The first problem I'm having is getting the update
page to show which values currently exist.  This is
the multi select box and the (adodb) recordset listing
all the options.  I'm lacking something in the page
though that allow it to see which values are already
chosen in the database:

<select name="inds[]" size="8" multiple id="inds[]">
<?php
while(!$rsInds->EOF){
?>
<option value="<?php echo
rsInds->Fields('CareerIDs')?>">
<?php if (count($IndID) > 0 AND is_array($IndID)) {
foreach ($IndID as $ind) { ?>
<?php if ($rsInds->Fields('IndID')== $ind) {echo
"SELECTED";} } }?>
<?php echo
$rsInds->Fields('CareerCategories')?></option>
<?php
$rsInds->MoveNext();
}
$rsInds->MoveFirst();
 
I've added this in the script, which prints out fine
once I've submitted the page.  Not sure if I need
something similar for the records that already exist ?

if (count($inds) > 0 AND is_array($inds)) {
    $ind = "'".implode("','", $inds)."'";
}

Stuart

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux