PHP Code:
<?php
$db = mysql_connect($hostpc,$user,$passwd);
mysql_select_db($database,$db);
$result = mysql_query("SELECT code,name FROM yourtable;");
if(mysql_num_rows($result)>0) {
echo "<table><tr>";
$count=0;
while ($i = mysql_fetch_row($result)) {
if (has_to_go_with_a_checkbox) {
if ($count==3){
echo "</tr><tr>";
$count=0;
}
echo "<td><input type=\"checkbox\" name=\"".$i[0]."\" value=\"".$i[0]."\" checked>".$i[1]."</td>;
$count++;
} else {
$noncheckboxAr= $i[1];
}
if ($count==1)
echo "<td> </td><td> </td></tr></table>";
else if($count==2)
echo "<td> </td></tr></table>";
else echo "</tr></table>";
foreach ( $noncheckbox as $noncheckboxAr ) {
echo $noncheckbox."<br>;
}
} else {
echo "No records found!";
}
?>
not tested, but should work for you
Bookmarks