Re: can't get printf() to work

From: Date: Sun, 29 Oct 2000 05:55:27 +0000
Subject: Re: can't get printf() to work
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22524@lists.php.net to get a copy of this message
On Sat, 28 Oct 2000, Gary wrote: > gives me the correct result. Here is the latest variation of what i am > using. The echo table cells works fine, not the printf. > > while ($myrow=mysql_fetch_array($result)); > If that's a verbatim copy and paste, that's the problem right there. The semicolon on the end of the while loop tells it to do nothing. It's equivalent to: while ($myrow = mysql_fetch_array($result)) { } So when it goes on, it prints out the table, and $myrow is now an empty variable because there were no more rows to fetch. You need to put the commands to print out the table heading before the while loop, and the printf statement inside the while loop. Also, unless you know exactly what's coming out of the database, you might want to use htmlentities($myrow["columm"]) -- Michael

« previous php.general (#22524) next »