Re: Really simple loop problem..
| From: | Wico de Leeuw | Date: | Wed, 11 Oct 2000 14:37:31 +0000 |
| Subject: | Re: Really simple loop problem.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19593@lists.php.net to get a copy of this message | ||
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);Hiya DO needs a WHILE like: Do {$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"]; }
++$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