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

php multiple action on submit
I have a form which says:

<form enctype='multipart/form-data' method='post' action='pr

filesize problem
i use ubuntu 9.10 and i have mountet a folder from an windows

/mount/FOLDER
/mount/FOLDER/

Paypal
Hi all,

I have an advanced basic knowledge of php

I want to try something new for a s

Help with file_get_html
The following code gives the expected results:

<html>
<head&g

Email "$"
Hello!!

Any PHP guy with a bit of a knowledge in Flash ?

When I send a JPEG from flash

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please help

Code: [Select]&l

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

php global variable
how can we create global variable so we can use its value in any form.. Please give example to

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

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