php/AJAX issue web development

I need help with AJAX. I want to UPDATE my DB without refreshing. I don’t really know how to do this. I have found piece of code online but for some reason is not working. Another thing is : how to make run PHP code after 5 minutes. For example: someone push the button and after 5 minutes my DB will be updated. Any Ideas?

Hi @markwain13,
For the DB issue you can check this website. php - prevent re-run of script on page refresh | DaniWeb

To make the DB run after 5 mins you can insert a function with delay in javascript.

The syntax goes like this.

setTimeout( function () {
} , 300000 );

Let me know in case you need any information.