Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

How to automatically refresh page every 1 minute?

Codes here !

Moderators: macek, egami, gesf

How to automatically refresh page every 1 minute?

Postby ShahriarNK » Mon Sep 03, 2012 3:59 am

Hi all
I have a PHP page that retrieves data from a MySQL database and displays it in a table.
(Here is the page incase you need to review the code: http://www.nagorik.org/ )

I would like this table to refresh every 1 minute and show any new data that has been entered.

What is the 'professional' way to do this?
Can someone point me to a tutorial/resource for implementing this?

Thanks in advance for your help.
ShahriarNK
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Sep 03, 2012 3:52 am

Re: How to automatically refresh page every 1 minute?

Postby Nullsig » Tue Sep 04, 2012 12:21 pm

Typically the full refresh of the page is considered bulky and annoying.

Instead you should only update the portion of the page that is changing. You can do this by utilizing AJAX.

Even in the case where your entire page is updating, I would recommend using AJAX with some conditional checks to look for changes in the data.


Lastly, from personal experience I would make it so that updates do not occur when the user is directly interacting with the data. On hover over the data or something along those lines, I would kill the update calls. If Killing the update calls is out of the question, I would then just make the data update on demand via a button or allow the user to pause the updates with the use of a button.
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
 
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: How to automatically refresh page every 1 minute?

Postby joomtalk » Fri Sep 21, 2012 8:26 am

use meta tag for refresh!!
search google: meta tag for auto refresh!!

ok dadash!!?? :D :D
joomtalk
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sat Jun 30, 2012 12:24 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.