RE: [PHP-DB] problem with WHILE loop
| From: | BoNzO | Date: | Mon, 01 Oct 2001 18:41:37 +0000 |
| Subject: | RE: [PHP-DB] problem with WHILE loop | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12884@lists.php.net to get a copy of this message | ||
$list = mysql_query("select id,title from table1");
while ($row = mysql_fetch_array($list)) {
echo("$row[title]<br>\n");
}
-----Original Message-----
From: Eric J Schwinder
[mailto:eric.AT.bergencomputing.DOT.com@pb1.pair.com]
Sent: den 1 oktober 2001 20:18
To: php-db@lists.php.net
Subject: Re: [PHP-DB] problem with WHILE loop
Thanks to everyone who replied either here or via e-mail... I got a lot
of
great suggestions. I ended up solving the WHILE problem by changing
this:
> $list = mysql_query("select id,title from table1");
> $list_row = mysql_fetch_array($list);
> $title = $list_row["title"];
> while($list_row) {
> echo("$title <br>\n");
> }
to this:
$list = mysql_query("select id,title from table1");
$title = $list_row["title"];
while($list_row = mysql_fetch_array($list)) {
echo("$title <br>\n");
}
Eric Schwinder
eric.AT.bergencomputing.DOT.com
AT = @
DOT = (well... you know)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net