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

Multithreading design
Hi

I have come up with a Singleton class that manages a pool of database connections. Basical

what does this mean? +=
is anyone able to explain what this code is saying?

i had it written for me awhile back and n

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

mysql_affected_rows() usage
Possibly a MySQL issue, but the function that is not behaving in the anticipated way is a PHP functi

Login Issue's
Code: <?php
$file = fopen('user.txt', 'r');

/* Set login to false initially */

SAP Business Suite
Hi all:

Within the SAP Business Suite solution I would like to ask you the main differenc

PHP Code To Change Font Color in Table Cell
I would appreciate help with the following snippet of my php code. I am just trying to change the f

Nested (echoed) php running wrong script
Got a problem with a php website I'm creating.

In a nutshell, the first page is entirely html

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

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