Hi there,
I'm trying to have a table of checkboxes where all of the values are from the db.
If the value is selected i want it to be checked.
This is what i have at the moment but it keeps giving me a parse error on the marked line.
I'm still new to php and cant see the problem.
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("fjc",$db);
$res2 = mysql_query("SELECT barristers.bar_id, bar_admis.bar_id, admissions.admis_id, admissions.admission FROM admissions, bar_admis, barristers WHERE (barristers.bar_id = bar_admis.bar_id) and (bar_admis.admis_id = admissions.admis_id",$db);
$cols = 4;
$counter = 1;
print '<table width=\"40%\" cellspacing=\"4\"><tr>';
while ($myrow = mysql_fetch_array($res2)) {
if (is_int($counter / $cols)) {
?>
*********** <td><input type="checkbox" name="<? echo ($myrow["admissions.admis_id"]); ?>" <? if ($myrow["bar_admis.bar_id"]) != 0 { echo ("checked");} ?>><span class="text"><? echo($myrow["admissions.admission"]); ?></span></td></tr><tr>
<?
}
else {
?>
<td><input type="checkbox" name="<? echo ($myrow["admissions.admis_id"]); ?>" <? if
($myrow["bar_admis.bar_id"]) != 0 { echo "checked";} ?>><span class="text"><? echo ($myrow["admissions.admission"]); ?></span></td>
<?
}
$counter++;
}
print '</tr></table>';
?>
thanks,
dunskii