Re: newbie algorithm help!!!!
| From: | Jon Yaggie | Date: | Wed, 23 May 2001 20:08:43 +0000 |
| Subject: | Re: newbie algorithm help!!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-54988@lists.php.net to get a copy of this message | ||
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
{
print"<tr><td>{$my_array[0]}</td>";
}
$i++:
}
</table>
or am i completely off on what you need?
please share if you know hwo to di it. thanks you
""McShen"" <webmaster@celeritieszones.com> wrote in message
news:9gqm6o$g6n$1@w153.z064000151.sjc-ca.dsl.cnc.net...
> 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 :
>
> entry1 entry2
> entry3 entry4
>
> Thanks in advanced.
>
Thank You,
Jon Yaggie
www.design-monster.com
And they were singing . . .
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
101 little bugs in the code . . .'
And it continued until they reached 0