Results 1 to 3 of 3

Thread: PHP only outputs same result for each database result
      
   

  1. #1
    Join Date
    Jan 2012
    Posts
    3

    Default 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";

  2. #2
    Join Date
    Jan 2012
    Posts
    3

    Default Re: PHP only outputs same result for each database result

    Please close this thread, it has been resolved

  3. #3
    Join Date
    Mar 2005
    Location
    Wilmington, Delaware USA
    Posts
    12,313

    Default 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)



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Posting Permissions

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