splitting chexboxs over 3 columns
Posted: Sun Aug 30, 2009 8:03 am
I'm trying to modify this code so it splits over 3 columns, but at the moment its only over 2. Any help will be much apriciated!
Code: Select all
$catNode = new sqlNode();
$catNode->table = "categories";
$catNode->select = "*";
// $_SESSION['FatherID'] was cleaned in header.php
$catNode->where = "where FatherID = {$_SESSION['FatherID']}";
$catNode->orderby = "order by Title asc";
if( ($catResult = $mysql->select($catNode)) === false )
die($mysql->debugPrint());
$num_checkboxs = mysql_num_rows($catResult);
$count = 0;
$break = ceil($num_checkboxs/2);
echo "<td valign='top' class='smallsearch'>";
echo "<input type='checkbox' name='searchFatherID' value='0' >All Areas<br/>";
while ( $cat = mysql_fetch_assoc($catResult) ){
echo "<input type='checkbox' name='searchFatherID[]' value='".$cat['ID']."' ";
if($option['Selected'] == "selected")
echo "checked='checked'";
echo " >";
echo $cat['Title'];
echo "<br/>";
if($count == $break)
echo "</td><td valign='top' class='smallsearch'>";
$count++;
}
echo "</td>";