Re: A better way of displaying query
| From: | christopher at moewes dot com | Date: | Wed, 02 Aug 2000 12:46:40 +0000 |
| Subject: | Re: A better way of displaying query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9686@lists.php.net to get a copy of this message | ||
IF al you want is a db dump you could try
print "<TABLE>";
while ($row = mysql_fetch_array($sql_result)) {
print "<TR>";
for $i = 0; $i < count($row; $i++){
print "<TD>$row[i]</TD>";
}
print "</TR>";
}
print "</TABLE>";
On Tue, Aug 01, 2000 at 05:58:45PM -0500, Mike Tuller wrote:
> I'm following an example in PHP essentials that shows how to display mysql
> database info in a HTML table. What I need to display is a mysql table that
> has over 20 columns and I want to know an easier way. Here is an example of
> what I have.
>
> while ($row = mysql_fetch_array($sql_result)) {
> $item1 = $row["item1"];
> $item2 = $row["item2"];
> $item3 = $row["item3"];
> $item4 = $row["item4"];
> etc,etc,etc
>
> echo
> "<TR><TD>$item1</TD><TD>$item2</TD><TD>$item3</TD><TD>$item4</TD>
> etc,etc,etc
> }
>
> Is there a better way? Such as:
>
>
> Thanks,
> Mike Tuller
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
--
Christopher R. Moewes-Bystrom
cmoewes@moewes.com
http://www.moewes.com
http://www.linuxnovice.org