title: How do I delete a record in php MySQL Database
body: <p>So I want to be able to delete a record in PHP using a button next to each row in the table. I cannot find a good tutorial anywhere that can help me with my problem and I am really stuck and don't know what to do.</p>
  
  <p>Here is my code if someone can tell me what to do:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;PCSS Grad Gown&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" href="Grad_Gown_Report.css"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
  &lt;script 
  src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
   &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;
  &lt;/script&gt;
  
  &lt;style&gt;
  
    body {
        background-image: url("http://www.miguelmontalban.com/wp-content/uploads/2015/11/uSr9bZA-fancy-background-images.jpg");
    }
  
    td {
        color: white;
    }
  
    .Grad_Table {
        color :white;
    }
   &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php
      $servername = "Private";
      $username = "Private";
      $password = "Private";
      $dbname = "Private";
  
  
      $conn = new mysqli($servername, $username, $password, $dbname);
      // Check connection
      if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  
      $order;
  } 
     $order = $_GET['order'];
      if (!$order) {
          $order = "name";
      }
  
      $sql = mysqli_query ($conn, "SELECT * FROM Information ORDER By $order");
  
      ?&gt;
  
      &lt;div class="table-responsive" id="grad_table"&gt;
  
          &lt;br&gt;
          &lt;br&gt;
  
      &lt;table class="Grad_Table" width="100%" border="12px"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;a href="Grad_Gown_Report.php"&gt;Name:&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;a href="Grad_Gown_Report_2.php"&gt;Student #:&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;Homeform #:&lt;/td&gt;
                  &lt;td&gt;Unit:&lt;/td&gt;
                  &lt;td&gt;Height:&lt;/td&gt;
                  &lt;td&gt;Size:&lt;/td&gt;
                  &lt;td&gt;&lt;/td&gt;
  
  
  
              &lt;/tr&gt;
  
          &lt;/thead&gt;
  
          &lt;tbody&gt;
              &lt;?php
  
              while ($rows = mysqli_fetch_assoc($sql)) {
              ?&gt;
  
              &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $rows['Name'];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $rows['Studentnum'];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $rows['Homeform'];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $rows['Unit'];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $rows['Height'];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $rows['Size'];?&gt;&lt;/td&gt;
  
  
  
  
  
  
  
  
  
              &lt;/tr&gt;
  
              &lt;?php
  
  
              }
  
  
              ?&gt;
          &lt;/tbody&gt;
  
  
      &lt;/table&gt;
  
      &lt;/div&gt;
  
  
  
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I can retrieve data from the database perfectly and everything else functions exactly how I want it. The only thing that I need is the delete function. I have tried many things, including the tutorial on W3 Schools, I tried the object oriented and procedural methods but they both give me the same error. I would really prefer a separate delete.php file, but I'm fine with anything that works.</p>