Re: how to format...
| From: | Daniel Rezny | Date: | Wed, 06 Sep 2000 08:00:55 +0000 |
| Subject: | Re: how to format... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2645@lists.php.net to get a copy of this message | ||
Hello Candy,
Wednesday, September 06, 2000, 9:51:55 AM, you wrote:
CZ> Hello, all
CZ> I want to run a recipe webiste with PHP&Mysql. And I have a table named
CZ> category with two fields: id, category_name. It has more than 10
CZ> category names.
CZ> I know how to query those categories dynamically created links, but I
CZ> have no clue about how to format the query result as following:
CZ> 2 categories in one row:
CZ> category1 category2
CZ> category3 category4
CZ> Any help would be highly appreciated.
try this:
?> <table><tr><?
$i=1
$query = "select cat1 from tbl_name where
(where_condition)";
$exec = mysql_query($query);
while($row= mysql_fetch_array($exec)) {
?><td><?echo $row["cat1"];
if ($i=2) {echo "</tr><tr>"; $i=1; }
$i++;
}
I hope this will help you
--
Best regards,
Daniel mailto:dr@photo.digitallaut.at