simple php table loop


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,

I've the following code

<?php // Create category options
$query = "SELECT * FROM categories ORDER BY category ASC";
$result = mysql_query ($query);
while ($row = mysql_fetch_array ($result, MYSQL_NUM)) {
echo "<input type="checkbox" name="types[]" value="$row[1]">$row[1]n";
}
?>

This lists out up to 15 checkboxes, but can increase or decrease if more are added/removed. At present this simply produces a list.
How can I alter the above to produce a nice table with say 5 checkboxes per row?

No comments posted yet

Your Answer:

Login to answer
207 Like 5 Dislike
Previous forums Next forums
Other forums

Count on multidimensional array
Hi, i got an array as below:

Array
(
=> Array
(

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...

Code: $define_li

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

Breaking results into week blocks
I have a set of dates (and times), which are returned from a mySQL query.

These usually span

Best way to read this text file.
Hi.I am planning to make a small application in C# to convert the players from Football manager 2010

Logic question
im wondering what's the best method to do the above list:

it is for alliance @ MMORPG game

Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when

Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash