php running while giving F5 while maintaining connection to the database

0

I have a function in Javascript that executes a PHP code, in this PHP I open connection to the database and send data if some entries receive 1 (waiting 1 minute to change their state).

When I refresh the page before this 1 minute, it performs Javascript and PHP again, thus creating a new connection to the database and creating more than one record at runtime.

What can I do? How can I stop execution of PHP code when updating the page? Would it be easier to terminate database connections when running PHP?

    
asked by anonymous 19.02.2016 / 14:57

1 answer

2

You can lock the F5 button, try this code:

link

This will block the F5 button until you upgrade.

    
19.02.2016 / 17:06