do a "while mysql_fetch_array loop" n+1 times

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • deggler@gmail.com

    do a "while mysql_fetch_array loop" n+1 times

    hi, i'd need to run a while ($row = mysql_fetch_arr ay($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
  • ZeldorBlat

    #2
    Re: do a "while mysql_fetch_arr ay loop" n+1 times

    On Feb 13, 12:10 pm, degg...@gmail.c om wrote:
    hi, i'd need to run a while ($row = mysql_fetch_arr ay($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_arr ay($result));

    Comment

    • C. (http://symcbean.blogspot.com/)

      #3
      Re: do a "while mysql_fetch_arr ay loop" n+1 times

      On 13 Feb, 17:10, degg...@gmail.c om wrote:
      hi, i'd need to run a while ($row = mysql_fetch_arr ay($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.

      Comment

      Working...