my last question was no quite good, so im sorry to "open" new one.
Importante data:
Table1
- id:1
- id:2
- id:3
Table2
- id:1
- id:3
Query1 (id Results):
- 1,2,3
Query2 (id Results):
- 1,3
So, I have a checkbox that need to be changed to "checked" if everytime that I fetch these 2 tables (with proper query ofc) and some id from table2 exists on table1.
Im doing like this:
<?php
while($row = mysql_fetch_array($Query1))
{
while($row2 = mysql_fetch_array($Query2))
{
$checkit = '';
if($row['id'] == $row2['id'] )
$checkit = 'checked="checked"';
}
?>
<input type="checkbox" name = "checkbox-1" class="checkbox" value ="" <?php echo $checkit ?> />
<?php
}
}
?>
Problem: I just can have "checked" for the first result, when 1=1.
That While fetch only once. I need that the result should be like this (id): 11-13 | 21-23 |31-33 and checked checkbox should appear only when 11 and 33
I hope that you understand this..