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

returning data from an ssh2_exec()
here's what i got.


$conn = ssh2_connect($this->_host);
ssh2_auth_password($c

problem in pagination when processing with selectbox form
Hi,

I have a search form, with select boxes, if am selecting the value from the form, it work

How to sum these output values
Hi

I need sum the month totals
SELECT region_name, area_name ,SUM (CASE WHEN S

Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

count only commas outside parenteses
I have a sql table containing
id - query - query name
the first page contains a drop down men

InternetOpenUrl() Invalid cert
Hi all,

Does anyone know how to prevent calls to InternetOpenUrl() from failing with erro

How to generate a text file using php...?
Hi,
Can anyone give me code to generate a text file using php


Thanks in advance

Secure pages Sessions vs. Cookies & session_destroy() help
Im new here and new to PHP, I hope you can help me with some questions.

Im writing my web ap

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

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