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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.