so far i have:

$sql="select * from cate order by name asc";
$resurs=mysql_query($sql);
while ($row=mysql_fetch_array($resurs))
{

echo  ".$row[1].";
echo  ".$row[2].";
echo  ".$row[3].";

}

how can i put all of this together?
echo "</table>";
----- Original Message -----
From: "Michael A Smith" <[EMAIL PROTECTED]>
To: "phpu" <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 1:43 AM
Subject: Re: [PHP] Table trouble


> fetchinto?
> On Mon, 2003-07-07 at 14:42, phpu wrote:
> > 10x but i am new to php and i do not know how to dump all of the results
> > into an array.... can you help me with this one please?
> >
> > ----- Original Message -----
> > From: "Kevin Stone" <[EMAIL PROTECTED]>
> > To: "phpu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 08, 2003 1:19 AM
> > Subject: Re: [PHP] Table trouble
> >
> >
> > > I'd just dump all of the results into an array and do something like
this:
> > >
> > > echo "<table border=1>\n";
> > > for($i=0; $i<count($array);)
> > > {
> > >     echo "\t<tr>\n";
> > >     for($j=0; $j<2; $j++)
> > >     {
> > >         echo "\t\t<td>".$array[$i]."</td>\n";
> > >         $i++;
> > >     }
> > >     echo "\t</tr>\n";
> > > }
> > > echo "</table>\n";
> > >
> > > On odd numbered arrays you'll end up with an empty cell.  Most
browsers
> > will
> > > handel the empty cell by simply not displaying it.  Others might show
the
> > > box.  It's a minor cosmetic thing but if you want it to look
consistent
> > then
> > > test for that situation and add a non-breaking space to the final
cell.
> > >
> > > HTH,
> > > Kevin
> > >
> > > ----- Original Message -----
> > > From: "phpu" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, July 07, 2003 4:03 PM
> > > Subject: [PHP] Table trouble
> > >
> > >
> > > Hello
> > > I need help.
> > > I'm querying a database then printing the results in a table. I want
the
> > > result to be in a table with 2 columns per row.
> > > something like that
> > >
> > > --------------------------------------------------------
> > > --                        --                          --
> > > --      row 1          --         row 2         --
> > > --                        --                          --
> > > --------------------------------------------------------
> > > --                        --                          --
> > > --      row 3          --         row 4         --
> > > --                        --                          --
> > > --------------------------------------------------------
> > > --                        --                          --
> > > --      row 5           --         row 6         --
> > > --                        --                          --
> > > --------------------------------------------------------
> > >      and so on.....
> > >
> > > How can I do that?
> > > Please help me asap
> > >
> > >
> > >
> > >
> > >
> --
> Michael Smith
> [EMAIL PROTECTED]
>
> "The great thing about democracy is that it gives
> every voter a chance to do something stupid."
>      -Art Spander
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to