I have a loop that writes out data for franchises. It works the first time through, but not the 2nd. Here is the page where the data is written out:

Here is the code that spits out the wrong data after the first successful loop. Any ideas?

$areaCodeData = getData($sSql, $con, $dbName);
       $areaCodeRowCount = mySQL_num_rows($areaCodeData);
       $areaCodeRowCur = mysql_fetch_assoc($areaCodeData);
       if ($areaCodeRowCount != 0) {
          echo "<div class='box left'>";
          // list all Area Codes for this Franchise
          echo "<div class='details'>";
          $areaCodes = "";
          for ( $ctrAreaCode = 0; $ctrAreaCode <= $areaCodeRowCount - 1; $ctrAreaCode += 1) {
             // grab AreaCodes
             $areaCodes = "<b>".$areaCodes.$areaCodeRowCur['AreaCode']."</b>, ";      
             // fetch next AreaCode row
             $areaCodeRowCur = mysql_fetch_assoc($areaCodeData);
          } // end ctrAreaCode for loop
          $areaCodes = substr($areaCodes, 0, strlen($areaCodes)-2)."<br />";
          echo "<em>-- Area Codes Supported:</em><br/>";
          echo $areaCodes;
          echo "</div>";
          echo "</div><br />";
       } //end Area Code loop
       // reset AreaCode loop pointers (is this a PHP bug?)

At this point I'm desperate and I have to get this working ASAP.

Thanks in advance for the help...

5 Years
Discussion Span
Last Post by pritaeas

Can you please explain what is wrong with your output (or what you want changed).

Edited by pritaeas: n/a


Grand Rapids, Kalamazoo, Holland area codes are
616, 269, 616
and their area codes are 49xxx

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.