Arun Killu
Arun Killu

Reputation: 14263

fetching database records using ajax polling

am am thinking of polling using ajax with a rate of 5 sec so that i get all updates before 5 sec from now with out losing any updates .is there a chance that i will miss out some data due to network latency or some other issue. can anyone suggest an method so that I get records if any UPDATE is made within 5 sec.

Upvotes: 0

Views: 181

Answers (2)

nithi
nithi

Reputation: 3887

You can send the total number of rows as parameter and check using that.

You can also check by sending the last id as parameter.

Upvotes: 0

erdeszt
erdeszt

Reputation: 791

If you send the ID (or insert date) of the last item you've got with previous update you can fetch the newer records from the database and you won't miss anything.

Upvotes: 1

Related Questions