title: Delete row mysql php
body: <p>Using the following code:</p>
  
  <pre><code>if (isset($_POST['delete']) &amp;&amp; isset($_POST['id']))
  {
      $first = get_post('first');
      $query = "DELETE FROM user_master WHERE id='$id'";
      if(!mysql_query($query, $db_server))
          echo "DELETE failed: $query&lt;br /&gt;" . 
          mysql_error() . "&lt;br /&gt;&lt;br /&gt;";
  }
  
  $query="SELECT * FROM user_master";
  $result= mysql_query($query);
  
  if(!result) die ("Database access failed: " . mysql_error());
  $rows = mysql_num_rows($result);
  
  for ($j=0 ; $j&lt;$rows ; ++$j)
  {
      $row = mysql_fetch_row($result);
      echo &lt;&lt;&lt;_END
      &lt;pre&gt;
      ID      $row[0]
      First   $row[1]
      Last    $row[2]
      Email   $row[3]
      User    $row[4]
      &lt;/pre&gt;
      &lt;form action="willingLog.html" method="post"&gt;
      &lt;input type="hidden" name="delete" value="yes" /&gt;
      &lt;input type="hidden" name="id" value="$row[0]" /&gt;
      &lt;input type="submit" value="DELETE RECORD" /&gt;&lt;/form&gt;
  _END;
  </code></pre>
  
  <p>I'm unable to delete a record form the table.  </p>
  
  <p>All the records form the table are printing on the screen, including the "DELETE RECORD" button.  When I hit the button, however, nothing happens.  I've checked the actual table on phpmyadmin, and the table is unaffected as well.</p>
  
  <p>I'm pulling this stuff from a book, so I don't understand why it's not working.</p>