Re: Update multiple records

From: Date: Tue, 11 Jan 2005 18:45:24 +0000
Subject: Re: Update multiple records
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38104@lists.php.net to get a copy of this message
Stumbling across some posts online, I noticed [some of] my messages were being sent as evil ugly HTML - so I'm going to do my best to post from Thunderbird for the list. Gotta keep OE configured as is for all the lovely meeting scheduling. Stuart Felenstein wrote:
--- Jochem Maas <jochem@iamjochem.com> wrote:
if (count($inds) > 0 AND is_array($inds)) { $ind = "'".implode("','", $inds)."'"; }
looks like you want to do a select statement with $ind in the form of "SELECT * FROM yourtable WHERE yourfield IN ($inds)"
Adding the IN clause did not help in any way. What I've been able to get so far is only the first record returned from the database (even though 2 exists) Using this result set it is picking up the correct user records: $query_rsLPINDS = sprintf("SELECT LurkProfiles_Industries.ProfileID, LurkProfiles_Industries.IndID, LurkerProfiles.ProfileID FROM LurkProfiles_Industries INNER JOIN LurkerProfiles ON (LurkProfiles_Industries.ProfileID = LurkerProfiles.ProfileID) INNER JOIN SignUp ON (LurkerProfiles.LurkID = SignUp.SignUpID) INNER JOIN StaIndTypes ON LurkProfiles_Industries.IndID = StaIndTypes.CareerIDs) WHERE LurkerProfiles.ProfileID = %s and LurkID = %s and hash = '%s'", $colname__rsLPINDS,$colname2__rsLPINDS,$colname3__rsLPINDS); I've created the variable for IndID like this : $IndID = $rsLPINDS->Fields('IndID'); which when I do a print_r($IndID), prints out the first record. So at this point I'm trying to figure out what I need to make $IndID an array. Stuart
If I remember correctly, you're using some kind of database class that we spent some time pinning down how to pull the values out of. If that is indeed the case - you need to request the next record to be able to pull that records value for the field in. I don't remember what package you were using - but whatever that is, I think you need to be running across your result set (foreach || while ) and requesting each result as you go (or you need to access the property of the object that stores the whole result set/etc.). Whatever the case - I'm like 95% sure that ->Fields('fieldname') was for "last pulled rows value of this field" or similar and was for pulling record by record. Cheers, - Martin Norland, Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.

« previous php.db (#38104) next »