By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 2,006 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

do a "while mysql_fetch_array loop" n+1 times

P: n/a
hi, i'd need to run a while ($row = mysql_fetch_array($result)) loop
thru the whole table and then one more time.
this last time the $row variable shouldn't get any values. i just need
everything in the loop be done one more time.

Thank u very much for your help

deggler
Feb 13 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Feb 13, 12:10 pm, degg...@gmail.com wrote:
hi, i'd need to run a while ($row = mysql_fetch_array($result)) loop
thru the whole table and then one more time.
this last time the $row variable shouldn't get any values. i just need
everything in the loop be done one more time.

Thank u very much for your help

deggler
Can you do the "one more time" at the beginning instead of at the end?

$row = null;

do {
//do something useful
} while($row = mysql_fetch_array($result));
Feb 13 '08 #2

P: n/a
On 13 Feb, 17:10, degg...@gmail.com wrote:
hi, i'd need to run a while ($row = mysql_fetch_array($result)) loop
thru the whole table and then one more time.
this last time the $row variable shouldn't get any values. i just need
everything in the loop be done one more time.

Thank u very much for your help

deggler
Why can't you refactor your code so it doesn't need the extra
iteration?

C.
Feb 14 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.