Forum Moderators: coopster
I have this code:
1--<? $Querytype = "select * from Type";
2--$resulttype = mysql_query($Querytype);
3--$timestype = mysql_num_rows($resulttype);
4--$i = 1;
5--while ($rowtype = mysql_fetch_assoc($resulttype)
6--AND $i <= $timestype)
7--{
8--$type1 = $rowtype ['type'];
9--echo $type1;
10--if (!type$i)
11--{?>
12--<input type="checkbox" name="type<? echo $i?>"
13--value="<? echo $type1?>">
14--<? }
15--else
16--{
17--?>
18--<input type="checkbox" name="type<? echo $i?>"
19--value="<? echo $type1?>" checked>
20--<?
21--}
22--$i++;
23--};
In line 10 i have an if statement containing this:
if (!type$i) which is not working....
because itshould be like this:
if (!$type$i) which is also not working...
HOW CAN I HAVE TWO VARIABLES as one string within my if () statement?!
PLZ HELP ME
[uk2.php.net...]
if(!${"type$i"}) {
// do stuff
} ;)