RE: [PHP] Really simple loop problem..

From: Date: Wed, 11 Oct 2000 14:28:27 +0000
Subject: RE: [PHP] Really simple loop problem..
Groups: php.general 
Request: Send a blank email to php-general+get-19594@lists.php.net to get a copy of this message
There's a while at the end of the loop, that was part of the code that was omitted for brevity. -----Original Message----- From: Wico de Leeuw [mailto:wico@cnh.nl] Sent: Wednesday, October 11, 2000 10:38 AM To: Chad Day; 'php-general@lists.php.net' Subject: Re: [PHP] Really simple loop problem.. At 10:22 11-10-00 -0400, Chad Day wrote: >Can someone tell me why this isn't working: > >$regionarray = array(ALC, AKA, PAX, DCW); > > $gstatssetup = "SELECT REGION, ZIP, GENDER, Q1, Q2, Q3, Q4, Q5, Q6, >Q7, Q8, Q9, AGE, COMMENTS from survey where TAKEN <= '$DATETO' and TAKEN >= >'$DATEFROM'"; > $getstats = mysql_query($gstatssetup); > > if ($row = mysql_fetch_array($getstats)) { > > do { > $TEMP = $row["REGION"]; > if (in_array($TEMP, $regionarray)) { > echo $row["REGION"]; > } Hiya DO needs a WHILE like: Do { ++$x } while ($x < 100); Greetz, Wico > (continue unneeded code here) > >It's not running that loop, and it should. If I do an echo of $TEMP, one of >the values is DCW, which is one of the values in the $regionarray. I've >tried putting quotes around $TEMP, single and double, etc. If I plug in >"DCW" for $TEMP in the in_array part, it works too. So there must be some >sort of syntax error I am not seeing. Anyone? :( > >Chad Day >Beach Associates > >When I speak german... I think german in my head... but like...Do skript >kiddies see a w40l3 8uncha 1's and 0's and 3's and 4's and 7's in their >h34d'5 w43n t43y R +a1k1n6 ? -- SirStanley > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#19594) next »