RE: [PHP-DB] incrementor in loop is not incrementing.. any thoughts?

From: Date: Tue, 05 Aug 2003 14:11:16 +0000
Subject: RE: [PHP-DB] incrementor in loop is not incrementing.. any thoughts?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-29680@lists.php.net to get a copy of this message
Hi There, Yeah.. it was a copy paste Trying again: $threadQuery = db_query("SELECT id,type,colourID FROM kcs_threads WHERE id=".escapeValue($typeResult[id])); for ($i=0;$threadResult = db_fetch($threadQuery);$i++) { echo $threadResult[colourID]." ".$i; } Output: 223 0 225 0 301 0 304 0 326 0 333 0 211 0 223 0 224 0 225 0 356 0 95 0 100HL 0 102 0 0 is equal to $i.. in other words - it is not incrementing. Sorry for the bad copy/paste. Hope this one is better. Aaron -----Original Message----- From: Matt Schroebel [mailto:MSchroebel@hsus.org] Sent: August 5, 2003 10:02 AM To: Aaron Wolski Subject: RE: [PHP-DB] incrementor in loop is not incrementing.. any thoughts? Is that a copy/paste? You're showing newlines which I don't see in the pasted code ... > -----Original Message----- > From: Aaron Wolski [mailto:aaronjw@martekbiz.com] > Sent: Tuesday, August 05, 2003 9:58 AM > To: php-db@lists.php.net > Subject: [PHP-DB] incrementor in loop is not incrementing.. > any thoughts? > > > I have this: > > $threadQuery = db_query("SELECT id,type,colourID FROM > kcs_threads WHERE > id=".escapeValue($threadsResult[id])); > for ($z=0;$threadResult = db_fetch($threadQuery);$z++) { > > echo $threadResult[colour]." ".$z; > > } > > which is producing: > > > 223 0 > > 225 0 > > 301 0 > > 304 0 > > 326 0 > > 333 0 > > 211 0 > > 223 0 > > 224 0 > > 225 0 > > 356 0 > > 95 0 > > 100HL 0 > > 102 0 > > > Obviously $z is not incrementing. ANY clue why? > > Thanks! > > Aaron > > Aaron Wolski, Project Manager > Martek Business Solutions Inc. > www.martekbiz.com <http://www.martekbiz.com/> > 905-780-9574 > aaronjw@martekbiz.com > >

« previous php.db (#29680) next »