PHP only outputs same result for each database result

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • AntonioWind
    Private

    • Jan 2012
    • 3

    PHP only outputs same result for each database result

    So the code below is what I have inside a while() loop
    while($nt=mysql_fetch_array($qt)){
    which outputs the results from the database, there is about 10 results in the database, all of them are posted. Now, I grab a specific data that changes from another website, but it keeps outputting the same result from $fetchstatus & $fetchbrief, but from the website I am fetching the data from all the information is suppose to be different. Is something preventing the proper data to be fetched for each result from the database?


    $htmlfetch = file_get_contents("$url$nt[state]");


    preg_match_all(
    '/<div id="track-info-status" class="IT-color"><span class="IT sprite-master">&nbsp;<\/span>(.*?)<\/div>
    <div class="IT-color">
    (.*?)
    <\/div>/s',
    $htmlfetch,
    $posts, // will contain the blog posts
    PREG_SET_ORDER // formats data into an array of posts
    );


    foreach($posts as $post) {
    $fetchstatus = $post[1];
    $fetchbrief = $post[2];
    }

    echo "$fetchstatus - $fetchbrief";
  • AntonioWind
    Private

    • Jan 2012
    • 3

    #2
    Re: PHP only outputs same result for each database result

    Please close this thread, it has been resolved

    Comment

    • VodaHost
      General & Forum Administrator

      • Mar 2005
      • 12356

      #3
      Re: PHP only outputs same result for each database result

      Closing the thread as requested!

      VodaHost

      Your Website People!
      1-302-283-3777 North America / International
      02036089024 / United Kingdom
      291916438 / Australia

      ------------------------

      Top 3 Best Sellers

      Web Hosting - Unlimited disk space & bandwidth.

      Reseller Hosting - Start your own web hosting business.

      Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


      Comment

      Working...
      X