this.user Posted July 12, 2010 Share Posted July 12, 2010 is there a way to create an open connection on a webpage? for example the page would show the items and quantity that comes from a table called products in a database. And each time the table is updated, the content of the page would change as well. I do not want to have to call the database every minute, rather have it automatically update when the data in the database is changed. Link to comment https://forums.phpfreaks.com/topic/207523-openconstant-connection-not-sure-where-to-post-this/ Share on other sites More sharing options...
TeddyKiller Posted July 12, 2010 Share Posted July 12, 2010 This would not be done with php. JQuery refresh might work, where it calls an external php page, and inputs the data into a div. Though that'll refresh over a number of seconds you choose. Not when its changed. Though if the user has JS turned off, it wont work at all. Not even put input in. So... Link to comment https://forums.phpfreaks.com/topic/207523-openconstant-connection-not-sure-where-to-post-this/#findComment-1084954 Share on other sites More sharing options...
radar Posted July 12, 2010 Share Posted July 12, 2010 I definately agree with Teddy here, realistically you cant check the database for changes without actually querying the database. You can get a pretty seamless look by using an AJAX/Jquery refresh, anything else would look just too awkward with the page refreshing as with AJAX you can get only the content of the page itself to refresh, and depending on the formatting of the page, any external systems you are using, and the size of the query results, this can be done lightning fast, so that you or other views almost cant tell. Link to comment https://forums.phpfreaks.com/topic/207523-openconstant-connection-not-sure-where-to-post-this/#findComment-1085001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.