simple php table loop


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

Hi all,

I've the following code

Did you know?Explore Trending and Topic pages for more stories like this.
<?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

Need help with a mail notify function
I was tasked with setting up a site that's been prewritten. The site is basically a form that captur

Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of infor

Results from Db outputted twice
Hey guys.. for come reason my data is outputted twise shown in the image below and i cant figure out

ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

how do i make a string??
hey guys,
can someone please tell me how to put data from the glob function into a string

Struct/union and scope problem!
HI all , I have
Code: in header.h typedef struct Node Link; /* ---------

Question handling xml data
Hello,

I have sucessfull followed this tutorial
http://www.phpfreaks.com/tutorial/handlin

mysql timestamp manipulation
How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:

from

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