i have a mysql table with approx. 30 entries.
I wanna get them(i know how to do that) and list them in a 2-column
table.
For those minimalist-typists among us... :-)
$rowcount = 0;
echo TABLETR\n;
while (list($whatever) = mysql_fetch_row($result)){
echo TD$whatever/TD\n;
please share if you know hwo to di it. thanks you
McShen [EMAIL PROTECTED] wrote in message
9gqm6o$g6n$[EMAIL PROTECTED]">news:9gqm6o$g6n$[EMAIL PROTECTED]...
hi
i have a mysql table with approx. 30 entries.
I wanna get them(i know how to do that) and list them in a 2-column table.
I
have
is this what you want? there must be an
easier way. i am sure some one else knows it be i would -
?php
$result = mysql_query("select * from
table");
?
table
$i = 0;
while($my_array =
mysql_fetch_array($result))
{
if($i%2)
{
print"td{$my_array[0]/td/tr";
}
else
{
I use this code to do this kind stuff:
- BEGIN ---
$result=mysql_query(...);
$columns=2; //Count of columns
$table="TABLE\n";
$table.='TR';
$col=0; //current column
//Draw table content
while ($row=mysql_fetch_row($result)){
}
echo /TABLE;
-Original Message-
From: Zak Greant [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 23, 2001 1:22 PM
To: McShen
Cc: Php-General
Subject: Re: [PHP] newbie algorithm help!
McShen wrote:
hi
i have a mysql table with approx. 30 entries.
I wanna get them(i know how
I wanna get them(i know how to do that) and list them in a
2-column table. I have been trying to use a loop to do it. But it
will only produce a 1-column table. it's like
entry 1
entey 2
entry 3
entry 4
etc
Please help me so that i can get this :
entry1 entry2
entry3 entry4
hi
i have a mysql table with approx. 30 entries.
I wanna get them(i know how to do that) and list them in a 2-column table. I
have been trying to use a loop to do it. But it will only produce a 1-column
table. it's like
entry 1
entey 2
entry 3
entry 4
etc
Please help me so that i can get this
?php
$array[0] = 0;
$array[1] = 0;
$array[2] = 0;
$array[3] = 0;
$array[4] = 0;
$array[5] = 0;
echo
table
tr
;
foreach($array as $pos = $val)
if ( !(@$row++ % 2) AND $row != 1)
echo
/trtr
td$val /td
;
else
echo
td$val /td
;
echo
/tr
/table
;
?
--
8 matches
Mail list logo