Lukeidiot Posted August 22, 2012 Share Posted August 22, 2012 Hey guys, and thanks for reading, I am trying to devise a way to make a pop-up box show whenever a new row is inserted into my MySQL database. Any ideas or suggestions, maybe even an example or helpful information pointing to the right thing will be extremely delightful. Thanks! Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 23, 2012 Share Posted August 23, 2012 What code have you written? Are you using any JS libraries? You know it's AJAX cause you posted here, where are you stuck? Quote Link to comment Share on other sites More sharing options...
xyph Posted August 23, 2012 Share Posted August 23, 2012 You need to run an AJAX call that grabs the id of the 'newest row' from the database. Run this every 5 seconds or so, and store the result in a JS variable. If the value that you fetch is different than the value you've previously stored, you know an update has happened. Quote Link to comment Share on other sites More sharing options...
Lukeidiot Posted August 26, 2012 Author Share Posted August 26, 2012 You need to run an AJAX call that grabs the id of the 'newest row' from the database. Run this every 5 seconds or so, and store the result in a JS variable. If the value that you fetch is different than the value you've previously stored, you know an update has happened. Hmm I've been trying some things but none have seemed to work out. Perhaps a small example code? Quote Link to comment 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.