I have a problem with checkboxes. I have some project they you can filter at categories. So the problem is when you want edit a project that automatic the correct category are checked. here you see a project but the categories are empty
In mine databank I use is a combo table - one to insert my categories and one for the project and there I have a combo table from.
Here you see my code for display the checkboxes
and select for editing so now I looking for some help, for checked the correctly checkbox
that belongs to that project.
<div id="categoriefilter">
<?php
$sql = "SELECT * FROM `categories` ORDER BY `id` ASC";
$cats = DB::getResult($sql);
foreach($cats as $cat){
?>
<label>
<input name="cat[]" type="checkbox" value="<?php echo $cat['id']; ?>" >
<?php echo $cat['categorienaam']; ?>
</label>
<?php
}
?>
</div>