title: "Delete row" button for MySQL in PHP
body: <p>I have a table that becomes populated with data from a MySQL database, and each row receives its own delete button.  I would like to have the option to delete each row separately with a delete button that deletes the corresponding row in the database.  How would I go about doing so?  Here's the part of the code that I have to far, which does not seem to work whatsoever.</p>
  
  <pre><code>if(isset($_POST['id'])) {
  $id = $_POST['id'];
  $delete = mysql_query($conn,"DELETE FROM mods WHERE id = '$id'");
  }
  </code></pre>
  
  <p>Unimportant code omitted.</p>
  
  <p>Table/Form Creation:</p>
  
  <pre><code>   echo "&lt;td&gt;&lt;form action=\"\" method=\"post\"&gt;&lt;/td&gt;";
     echo "&lt;tr class='modlist'&gt;";
     echo "&lt;td&gt;".$row['id']."&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div class=\"edit\" id=\"div_1\"&gt;".$row['title']."&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div class=\"edit\" id=\"div_2\"&gt;&lt;a href=".$row['mod_url']."&gt;".$row['mod_url']."&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div class=\"edit\" id=\"div_3\"&gt;".$row['developer']."&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div class=\"edit\" id=\"div_4\"&gt;".$row['type']."&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div class=\"edit\" id=\"div_5\"&gt;".$v162."$nbsp".$v164."$nbsp".$v172."&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div class=\"edit\" id=\"div_6\"&gt;".$row['title'].",$nbsp".$row['developer']."&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div id=\"save\"&gt;&lt;input type=\"submit\" name=\"save\" value=\"Save\"&gt;&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;td&gt;&lt;div id=\"delete\"&gt;&lt;input type=\"submit\" name=\"delete\" value=\"Delete\"&gt;&lt;/div&gt;&lt;/td&gt;";
     echo "&lt;/tr&gt;";
     echo "&lt;/form&gt;";
     }
  </code></pre>