Jump to content

PHP MySQL, pop up box when a new row is inserted in mysql database?


Lukeidiot

Recommended Posts

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!

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.

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? :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.