Limit it in your query statement i.e.
SELECT * FROM whatever LIMIT 1,20
Jerry Lake - [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
-----Original Message-----
From: Bob Stone [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to limit a WHILE statement?
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]