title: Delete one record from MySQL Database
body: <p>I am trying to make a PHP script that fetches records from the database, the fetching is working fine but the problem is that when I click <code>DELETE BUTTON</code>, it deletes all the records from the database, what I need to do here is to delete a specific record (the record on the row only), how can I do that?</p>
  
  <p>Here is my code: </p>
  
  <pre><code> &lt;table width="99%" border="0"&gt;
          &lt;tr&gt;
            &lt;td align="center"&gt;ID&lt;/td&gt;
            &lt;td align="center"&gt;Username&lt;/td&gt;
            &lt;td align="center"&gt;EDIT&lt;/td&gt;
            &lt;td align="center"&gt;DELETE&lt;/td&gt;
          &lt;/tr&gt;
  
            &lt;? 
        while ($fetch=mysql_fetch_array($q))
  {
      ?&gt;          
          &lt;tr&gt;
            &lt;td align="center"&gt;&lt;? echo $fetch['useId']; ?&gt;&lt;/td&gt;
            &lt;td align="center"&gt;&lt;? echo $fetch['userUserName']; ?&gt;&lt;/td&gt;
            &lt;td align="center"&gt;&lt;? echo $fetch['useId']; ?&gt;&lt;/td&gt;
            &lt;td align="center"&gt; &lt;input name="delete" type="submit" value="DELETE " onclick="&lt;? mysql_query("DELETE FROM user WHERE useId = ". $fetch['useId'] ."") ?&gt; "/&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;? } ?&gt;
  
        &lt;/table&gt;
  </code></pre>