Re: Mysql Show SQL
| From: | Christian Reiniger | Date: | Wed, 14 Mar 2001 17:07:24 +0000 |
| Subject: | Re: Mysql Show SQL | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43875@lists.php.net to get a copy of this message | ||
On Wednesday 14 March 2001 14:41, you wrote:
> > $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.
It will. Once. First it fetches all matching rows from the database (each
time overwriting previous results):
> > while ($row = mysql_fetch_row($result));
Then it executes the code after the while:
> > {
> > for ($i =1;$i<mysql_num_fields($result);$i++)
> > {echo $row[$i];
> > }}
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
CPU not found. retry, abort, ignore?