title: Disable html button if database column contains > 0
body: <p>I have a table, <code>eventID, remainingTime, serverRestart, autoRestart </code><br/><br/>
  When the user clicks submit on my form, it updates the columns to the values I need, but they can continuously click the button and always update the database. I am wanting to disable the submit button after they click it once. I have tried many different options on SOF but nothing works how it should.</p>
  <p>What I have tried is the following <br/></p>
  <pre class="lang-php prettyprint-override"><code>$checkForUpdate = &quot;SELECT `remainingTime` FROM `serverrestart` WHERE eventID = 1&quot;;
  $result = mysqli_query($dbCon, $checkForUpdate);
  </code></pre>
  <p>and my form;</p>
  <pre class="lang-php prettyprint-override"><code>&lt;?
                      
                      while($row = mysqli_fetch_array($result)){
      if(strpos($row['remainingTime']) === false) {
          echo &quot;&lt;button class='btn btn-primary' type='submit' name='restart' disabled&gt;Initiate Restart&lt;/button&gt;&quot;;
      } else {
          echo &quot;&lt;button class='btn btn-primary' type='submit' name='restart'&gt;Initiate Restart&lt;/button&gt;&quot;;
      } 
  }
  ?&gt;
  </code></pre>
  <p>I also used this -&gt; <a href="https://stackoverflow.com/questions/55646301/how-to-disable-button-based-on-database">How to disable button based on Database?</a> as a guide also, but the button is always disabled.</p>
  <p>So in short.. The user clicks &quot;Initiate Restart&quot; the database fields populate with their values, and the page refreshs, I am wanting the page to refresh but disable the button based on the value in the field <code>ramainingTime</code> which is always <code>30</code></p>