Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Location
    Chicago, IL
    Posts
    169
    Thanks
    26
    Thanked 3 Times in 3 Posts

    Refreshing intelligently

    I have a table populated by MySQL data. Every 5 seconds, that table is refreshed on a php page with my grab_data() function (AJAX). Sometimes I want to insert or delete entries. I do this using insert() or delete(), respectively. However, those changes aren't reflected until grab_data() refreshes. This can take up to 5 seconds, and I don't like the lag. I feel that having a shorter refresh period is not the way to go. Is there a better way to refresh grab_data() ie only when it's called rather than every so many seconds?

    Thanks!

  • #2
    Senior Coder ckeyrouz's Avatar
    Join Date
    Jun 2009
    Location
    Montreal, Canada
    Posts
    1,044
    Thanks
    5
    Thanked 179 Times in 179 Posts
    simply force calling the query that returns the data explicitly after the insert or delete


  •  

    Posting Permissions

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