title: How to change boolean value in database
body: <p>I am writing a program using html/php/javascript. The purpose of the program is to have a list of jobs for a person to do (these jobs are stored in a database). When they complete a job they can click a button so the job with be changed to done (or true). There is no user input just a button for the user to click to mark the job as finished. The question is how do I change the value in the "Done" column in the database when the button is clicked for the specific job?</p>
  
  <pre><code>&lt;html&gt;
  
  
  &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt; Business Name&lt;/th&gt;
              &lt;th&gt; Address &lt;/th&gt;
              &lt;th&gt; Done &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  
      &lt;tbody&gt;
          &lt;?php
  
              $servername = "localhost";
              $username = "root";
              $password = "";
              $dbname ="myDB";
  
              $conn = new mysqli($servername, $username, $password, $dbname);
              if($conn-&gt;connect_error){
              die("Connection failed: " . $conn-&gt;connect_error);
              }
  
              $sql = "Select * from jobs where done = '1'";
              $result = $conn-&gt;query($sql);
  
              while ($row = mysqli_fetch_assoc($result)):
              $businessname = $row['Business'];
  
  
  
          ?&gt;
  
          &lt;tr&gt;
              &lt;td&gt;&lt;?php echo $row['Business']; ?&gt; &lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['Address']; ?&gt; &lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['Done']; ?&gt; &lt;/td&gt;
              &lt;td&gt; &lt;button type = 'submit' name = 'Done' value = '{businessname}' &gt;Accept&lt;/button&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
  
          &lt;?php endwhile; ?&gt;
      &lt;/tbody&gt;    
  &lt;/table&gt;
  &lt;/html&gt;
  </code></pre>