I am trying to display an array of data produced from an sql query. this works fine. However I now wish not to display 1 item where the id attribute = a value. code:
<?php foreach($sheet_list as $key => $sheet) : ?>
<?php if($sheet['id'] == $selected1){unset ($sheet_list[$key]);}?>
<tr>
<td><?=$sheet['title'];?></td>
<td><?php echo date('d F Y', strtotime($sheet['startDate'])); ?></td>
<td><?php echo date('d F Y', strtotime($sheet['endDate'])); ?></td>
<td><input type="radio" name="selected2" id="selected2" value="<?=$sheet['id'];?>" <?php
if ($key == 0) echo ' checked ';
?>/></td>
</tr>
<?php endforeach; ?>
so this is producing a table which is fine, however it is in the foreach loop where i want NOT to display 1 array item and all its attributes where the "id" field is = to the variable $selected1
I have seen lots of questions posted here, however many for 1 or two dimensional arrays.
Please help.