Really simple loop problem..
| From: | Chad Day | Date: | Wed, 11 Oct 2000 14:22:48 +0000 |
| Subject: | Really simple loop problem.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19592@lists.php.net to get a copy of this message | ||
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"];
}
(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