title: PHP checkbox return value (checked/not checked) and update
body: <p>I have a form that submits a load of checkboxes - This works fine. </p>
  
  <p>I then have a form i can open which will display said checkboxes and will be checked or not checked based on the SQL query ran. </p>
  
  <p>SQL query runs ok with echo but I cannot get the box to show as checked. After this I want to be able to check uncheck the boxes and update via an SQL.</p>
  
  <pre><code>&lt;?php
      session_start();
      ini_set('display_errors', 1); error_reporting(-1);
      $data = $_GET['id'];
      require 'connect.php';
      $sql1 = "SELECT id, phone, email, pager
      FROM [dbo].[preference] WHERE id = '$data'";
      $stmt1 = sqlsrv_query($con,$sql1);
      if( $stmt === false) {
      die( print_r( sqlsrv_errors(),true));
  }   
          while ($row1 = sqlsrv_fetch_array($stmt1)){
          $id = $row1['id'];
          $phone = $row1['phone'];
          $email = $row1['email'];
          $pager = $row1['pager'];
  }
  ?&gt;
  
  
  &lt;td&gt;&lt;input type="checkbox" name="phone" class="check" value="1"&gt;phone&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" name="email" class="check" value="1"&gt;email&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" name="pager" class="check" value="1"&gt;pager&lt;/td&gt;
  </code></pre>
  
  <p>How can I resolve this?</p>