I have a query, as below that makes no sense.
$adminquery=mysql_query("SELECT id FROM table WHERE id='$id'",$db);
$numgames = mysql_num_rows($adminquery);
while ($games=mysql_fetch_array($adminquery)) {
$id[] = $games["id"];
}
for ($i=0;$i<=$numgames-1;$i++) {
echo "$id[$i]<br>";
if ($id[$i] == "$agame") {$aaccess = '1';} else {$aaccess = '0';}
}
This outputs
1
2
3
4
to the browser, which is good, but it always sets $aaccess to 0.
If I change the if line to
if ($id[1] == "$agame") then it works okay (id[1] is 2, the value I give $agame) but this makes no sense as the echo proves that the for() array works okay.
I've been messing about with this for hours, as has a friend but neither of us can make it work and its driving me nuts!
Any help much much appreciated!