php running when giving F5 maintaining database connection

Asked

Viewed 86 times

0

I have a function in Javascript that runs 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 status).

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

What can I do? Can I stop running PHP code when updating the page? It would be easier to finish database connections when running PHP?

  • You can perform a validation before entering the new record. Checks whether at a given time such an Internet candidate in the bank is already present, if it is, simply ignores the new Internet.

1 answer

2

Browser other questions tagged

You are not signed in. Login or sign up in order to post.