Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6614319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:19:30+00:00 2026-05-25T20:19:30+00:00

The following page loads inside of on my index.php. I initially call it using

  • 0

The following page loads inside of on my index.php. I initially call it using the following link: Import Mutuals

This part works dandy. The problem I’m having is with the refresh code at the bottom: var auto_refresh = setInterval(function(){\$(‘#import’).show(‘fast’).load(‘fb_import_statuses.php?i=$i’).show(‘fast’);}, 1000);

I want it to initially load with record 1 and then keep refreshing, updating my SQL until it reaches record 255. If I do this same code outside of a DIV using Meta Refresh it steps through the sequence fine, but using this JavaScript refresh it will sequence like this:

1, 2, 3, 2, 3, 4, 2, 3, 4, 5 etc…

How can I get it to sequence as 1, 2, 3, 4, 5, 6, 7 etc…

require 'batch_include.php';
require 'html_head.php';

if (isset($_GET['i'])){$i = $_GET["i"];} else {$i=0;}

$getcount = mysql_query("SELECT COUNT(id) AS get_count FROM people", $conn);
while ($row = mysql_fetch_array($getcount)){$get_count = "".$row{'get_count'}."";}

   $result = mysql_query("SELECT id FROM people LIMIT ".$i.",1", $conn);
   while ($row = mysql_fetch_array($result)){                                    
        $get_uid = addslashes("".$row{'id'}.""); 

    $me_friends = $facebook->api(array('method' => 'fql.query', 'query' => 'SELECT     status_id, message, source, time FROM status WHERE uid="'.$get_uid.'" LIMIT 5'));
    foreach ($me_friends as $fkey=>$me_friends){
        $get_status_id = $me_friends['status_id']; 
        $get_message = addslashes($me_friends['message']); 
        $get_source = $me_friends['source']; 
        $get_timestamp = $me_friends['time']; 

    $insert = mysql_query("INSERT INTO statuses (id, message, source, timestamp, uid)      VALUES ('$get_status_id', '$get_message', '$get_source', '$get_timestamp', '$get_uid')",     $conn);        
    }  
}             
$i = $i + 1;

if ($i<=$get_count){
echo "$i";
echo "<script>var auto_refresh = setInterval(function(){\$('#import').show('fast').load('fb_import_statuses.php?i=$i').show('fast');}, 1000);    </script>";
}

else {    
    echo "Import complete:  ";
    echo "<img src='/images/check.png'>";

    } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:19:30+00:00Added an answer on May 25, 2026 at 8:19 pm

    the problem is that you add multiple setInterval functions (everytime the page is loaded you echo another method). try putting your refreshing method out of the div or make it call a function that includes php code responsible for retrieving information from db.

    if you don’t have to refresh the page every second, you could get all the data from db with one php file and return it in some form (json for example). I think this would be the best way to do this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following works in current Firefox (PDF loads), but not in current IE (page
I am using following function to load the page. I have loads of links
I'm using asp.net with url rewrite . Inside Page Load I have the following
I'm doing an app which loads as tab (iframe) inside a Page I'm using
I have the following code in a page (index.php), it's composed by just two
When I load the following page in IE9 on Windows 7 then it loads
I'm building a webpage and I'm getting the following warning (and the page loads
We're on Rails 3.0.6. Will the following code persist across page loads and users
I am developing simple facebook canvas app. I was following this page in documentation:
I have a page that loads a div via AJAX. The AJAX POST call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.