the breedsid array will be checked.codes shown -
<?php
$breedlist = array();
$q = mysql_query("SELECT id,breed,code FROM breeds
ORDER BY breed");
$total = mysql_num_rows($q);
while($i = mysql_fetch_array($q))
{
$checked = "";
$breedid2 = $i["id"];
$breed2 = $i["breed"];
for($k = 0; $k < count($breedsid); $k++)
{
if($breedsid[$k]==$breedid2){$checked = "CHECKED";}
}
echo ' <tr>
<td valign="top" class="bodymediumblk" align="left">
<input type="checkbox" name="checkbox[]"
value= "'.$breedid2.'" '.$checked.'>'.$breed2.'
</td></tr>';}?>