Answer the question
In order to leave comments, you need to log in
Why does one while loop interfere with another?
Because of the second loop, the $a1['nomer'] variable does not iterate over the values it has, but simply output the first value (inside the second loop), because of this, I cannot check the input. How to be?
If you do echo $a1['nomer'] in the first loop, three values are displayed. If the same thing is displayed in the second cycle, the first value, then there is one.
<?php
$x=0; $i = 24;
$rf= mysql_query("SELECT * FROM `zRestoran` WHERE idrest='$id' and data='$data' and time='$time'");
while ($a1= mysql_fetch_assoc($rf)){
while ($x<=$i ) { $x++; ?>
<input type="checkbox" <? if($a1['nomer']==$x){?> disabled="disabled" <? } ?> name="stolik[]" value="<? echo $x; ?>"><? echo $x; ?>
<?php }} ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question