SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    455
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    advancing the pointer in a mysql_fetch_array while loop

    How do I advance the pointer to the next row within a while loop using mysql_fetch_array?
    Code:
    while ($row = mysql_fetch_array($result)) {
    $zip11 = $row['postnet ip'];
    include "postnet2.php";
    
    //SOME MORE PROCESSING
    
    //I NEED TO ADVANCE THE POINTER HERE TO THE NEXT ROW
    
    //SOME MORE PROCESSING
    
    }

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    I guess one or both of us are missing something. mysql_fetch_array()
    PHP: mysql_fetch_array - Manual
    Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    455
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    $row = mysql_fetch_array($result); when I need to advance to the next row in the middle of a while loop (I was missing ";")

    Thanks,

    Niche


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •