Re: Mysql Show SQL

From: Date: Wed, 14 Mar 2001 13:41:09 +0000
Subject: Re: Mysql Show SQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43826@lists.php.net to get a copy of this message
On Tue, Mar 13, 2001 at 03:07:45PM -0500, Mike wrote: > <?php > require("Connection.php"); > $query="Show Columns from Inventory"; > $result= mysql_query($query); > while ($row = mysql_fetch_row($result)); > { > for ($i =1;$i<mysql_num_fields($result);$i++) > {echo $row[$i]; > }} > ?> 2 problems. 1. Delete the ';' after the while loop. With that there the for loop will never run. 2. If you want to print everything, you will need to change $i =1 to $i =0 in the for loops. -- Jason Stechschulte jpstech@unoh.edu -- Anyway, my money is still on use strict vars . . . -- Larry Wall in <199710011704.KAA21395@wall.org>

« previous php.general (#43826) next »