title: How to disable button based on sql query?
body: <p>I need to disable or hide, button if exists<code>username</code> in the table, and <code>==</code> logged in user</p>
  
  <p><strong>For example:</strong> username <code>John</code> exists in table <code>paym</code> we should disable button to <code>John</code></p>
  
  <p>table: <code>paym</code></p>
  
  <pre><code> ID        username        column1      column2  
  +-------+-------------+-------------+-----------+
  |   1   |  John       |  Value      |    Value  |
  +-------+-------------+-------------+-----------+
  |   2   |  Alex       |  Null       |    Null   |
  +-------+-------------+-------------+-----------+
  </code></pre>
  
  <p><strong><em>May be some syntax error or error in Query??</em></strong></p>
  
  <pre><code>&lt;?php
    $sql = "SELECT * FROM paym WHERE username = '" . $_SESSION['username'] . "'and column1 IS NOT NULL ";
    $result = mysqli_query($connection, $sql);
         if($result === true) {
          echo "&lt;button class='btn btn-primary' disabled='disabled' name='add_box'&gt;Add Box&lt;/button&gt;";
      } else {
          echo "&lt;button class='btn btn-primary' type='submit' name='add_box'&gt;Add Box&lt;/button&gt;";
      } 
    ?&gt;
  </code></pre>