The following code works perfectly, but if I have got 40 check boxes, it does really look attractive if they are all underneath one another. How can I break say on result 20 and start a new column set next to it to finish of the rest of the result set.
Hope it makes sence!
if(!($connect = @ mysql_connect($db_host, $db_user, $db_pass)))
die(mysql_error());
if(!mysql_select_db($db, $connect))
die(mysql_error());
$sql = "SELECT column1, column2, column3 FROM table";
$result = mysql_query($sql, $connect);
echo "<form><table>";
while($data = mysql_fetch_array($result))
{
//double check for the hell of it!
if(isset($data['column1']) && ($data['column1'] == true))
$data['column1'] = 'checked';
//print the information and checkboxes
echo "<tr><td><input type=\"checkbox\" name=\"".$data['column2']."\" value=\"".$data['column3'].
"\""; echo $data['column1']."></td><td>".$data['column2']."</td></tr>";
}
echo "<tr><td></td><td><input type='button' value='submit' name='submit'></td></tr>";
echo "</table></form>";
thanks in advance