0

So I have a table with content from a database and I want it to automatically refresh if new content arrive to the database. How can I do it?

I have seen this code but I don't want it to be asking everytime the server if information has arrived. I think that way it will overload the server. What do you think?

Please give me some tip to how can I do this.

Thanks in advance

1
  • New browsers support push notifications, you could use those and avoid support for old browsers. You could also use web sockets to keep a connection open and have a trigger in the database that sends a message saying new content available. You could always start by googling 'push notification for websites' Commented Dec 29, 2013 at 5:26

2 Answers 2

1

HTML5 supports websockets.

Nearly all major PC browsers supports web sockets. You can check the compatibility in http://caniuse.com/websockets

You can learn more about the html5 websockets in http://www.html5rocks.com/en/tutorials/websockets/basics/

Sign up to request clarification or add additional context in comments.

Comments

0

for push Notification I don't think php is best language for. I think you should use Nodejs for this. write your entire page in php and use node.js for live notifications. Simply run node.js on differant port and then run on apache. remind that php and node.js are two differant processes. so nither you can call stuff between them nor you can call node.js function to client side.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.