CodyBecker Posted May 2, 2009 Share Posted May 2, 2009 Hi all, im a little new to PHP. Does PHP have the ability to "PUSH" or auto-update sql information without having to refresh the entire page? Thank Everyone. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/ Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 Though AJAX, yes. Or CRON. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823878 Share on other sites More sharing options...
CodyBecker Posted May 2, 2009 Author Share Posted May 2, 2009 Argggggg I have no idea how to use either of those........ Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823880 Share on other sites More sharing options...
the182guy Posted May 2, 2009 Share Posted May 2, 2009 You'll need to be more specific about what you actually want to achieve. There is a rather large difference between AJAX and the Crontab. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823881 Share on other sites More sharing options...
CodyBecker Posted May 2, 2009 Author Share Posted May 2, 2009 Do you AIM? That would make it eaiser to converse. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823884 Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 What's wrong with posting? Just explain what you want to do. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823886 Share on other sites More sharing options...
CodyBecker Posted May 2, 2009 Author Share Posted May 2, 2009 K. Will try. ummmmmmmmmmm I have created a low end Police Dispatching program. However if i use the meta refresh script my site will last for about 3 mins before it crashes. So i need to know if there is a way to query only a small part of the page to check to see if the information has changed and if it has to display it. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823889 Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823893 Share on other sites More sharing options...
the182guy Posted May 2, 2009 Share Posted May 2, 2009 As Ken suggests, this is a perfect situation to make use of AJAX. I recommend using the jQuery framework because it simplifies a lot of the code that you would otherwise have to deal with. Three parts to this system: 1. A PHP page (or other server side script) which outputs the small section of data to display. This page will never be shown to the user but will be called behind the scenes by jQuery. 2. The javascript to make the AJAX call to the above PHP script. It needs to retrieve the data and update the page with the new info. 3. Use some javascript code to create a timer that will keep calling the AJAX code after x secs/mins. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823898 Share on other sites More sharing options...
CodyBecker Posted May 2, 2009 Author Share Posted May 2, 2009 Ok, any examples or templates i could find somewhere? I have a bad habbit of learning as I go or changing others to work for me. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823900 Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 CodyBecker: Google! You can find AJAX almost anywhere. Gotta learn how to Google. the182guy: for number 3, setInterval works. Quote Link to comment https://forums.phpfreaks.com/topic/156466-auto-update-push-php-noob-question/#findComment-823902 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.