title: Delete record with php then reload page
body: <p>I am building a simple webpage that will allow the user to delete a record from a database and then the page will reload with the record deleted. Having trouble figuring out the code to use to accomplish this. Here is my main page:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Change Record form&lt;/title&gt;
  
  &lt;style type="text/css"&gt;
  td {font-family: tahoma, arial, verdana; font-size: .875em }
  &lt;/style&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;a href="add_new_form.php"&gt;Add new record&lt;/a&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;?php
    $con=mysqli_connect("localhost", "root", "", "customers");
       if (mysqli_connect_errno()) {
     echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
  
  $strSQL = "SELECT * FROM music";
  
  $rs = mysqli_query($con, $strSQL);
  
  while($row = mysqli_fetch_array($rs, MYSQLI_BOTH)) {
  
     // Write the value of the column FirstName (which is now in the array $row)
    echo "&lt;br&gt;";
    echo "&lt;br&gt;";    
    echo $row['artist'] . "&lt;br /&gt;";
    echo $row['title'] . "&lt;br /&gt;";
    echo $row['format'] . "&lt;br /&gt;";
    echo $row['notes'] . "&lt;br /&gt;";
  
    echo '&lt;FORM METHOD="LINK" ACTION="update_form.php"&gt;
          &lt;INPUT TYPE="submit" VALUE="Update"&gt;
          &lt;/FORM&gt;';
  
    echo '&lt;FORM METHOD="LINK" ACTION="delete_process.php"&gt;
          &lt;INPUT TYPE="submit" VALUE="Delete"&gt;
          &lt;/FORM&gt;';
   }
  ?&gt; 
  </code></pre>
  
  <p>And then this is the delete_process page:</p>
  
  <pre><code>&lt;?php
  $id = $_GET['id'];
  $artist = $_GET['artist'];
  $title = $_GET['title'];
  $format = $_GET['format'];
  $notes = $_GET['notes'];
  
  //create connection to DB
  $con=mysqli_connect("localhost", "root", "", "customers");
  
  //check connection
  if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $sql = "DELETE from 'MUSIC' WHERE 'id' = $id";
  
  mysql_query($sql);
  ?&gt;
  </code></pre>
  
  <p>Basically when the user clicks the delete button, that particular record will be deleted and the main page will reload with the record deleted. Don't really know the code, thanks!</p>