How to limit a WHILE statement?

From: Date: Mon, 02 Apr 2001 22:53:27 +0000
Subject: How to limit a WHILE statement?
Groups: php.db 
Request: Send a blank email to php-db+get-8158@lists.php.net to get a copy of this message
Dear PHP Helpers, What is your recommendation on limiting a while statement so that it only iterates a maximum of 20 times? Here is the code snippet: $result = mysql_query($sql, $db); while ($myrow = mysql_fetch_array($result)) { printf("Name: <b><font color=\"green\" size=\"5s\">%s %s %s %s\n<br></b></font>", $myrow["salutation"], $myrow["first_name"], $myrow["mid_name"], $myrow["user_name"]); Best regards, Bob Stone __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text

« previous php.db (#8158) next »