Setting something in DB only once
<p>I'm using a setInterval to detect a value I get from my PLC(Programmable logic controller) When it is <code>1</code> it executes a PHP page that inserts data in my MYSQL database. </p>

<p>So when I'm holding my button down for longer than 1 second, it sets the DB values multiple times in it.</p>

<p>Below you can find my code:</p>

<pre><code>var Axo800RstBtn;

setInterval(function()
{
    Axo800RstBtn = document.getElementById('Axo800BtnStatus').innerHTML;
    var BatchUnits1 = document.getElementById('Axo800BatchProduction').innerHTML;

    if(Axo800RstBtn == 1)
    {   
        $.ajax({
        method: "POST",
        url: "SetBatchProductionInDB.php",
        data: { 
                machineNumber: 1,
                actualProduction: BatchUnits1 
              }     
        })
        .done(function(msg)
        {
            console.log("Bericht: " + msg);
        })
    }
},1250);
</code></pre>

<p>Is there a way to tell my page it can only execute once per 1 minute? some kind of block. Or maybe a block on the execute query?</p>