<?php
$rf= mysql_query("SELECT * FROM `zRestoran` WHERE idrest='$id' and data='$data' and time='$time'");
$nums = [];
while($row = mysql_fetch_assoc($rf)) {
$nums[] = $row['nomer'];
}
for( $x = 1; $x <= 20; $x++ ) {
<input type="checkbox" <? if (in_array($x, $nums)) echo 'disabled="disabled"'; } ?> name="stolik[]" value="<?= $x ?>"><?=$x ?>
}
?>