Deleting a row from the database based on id from while loop
<p>I have a while loop that pops out all of my blog posts. Along with these blog posts it puts up a button beside each one with a red x that when I click it I want it to delete the post next to it. The problem? I haven't come up with an effective way for it decide which post to delete. It usually either deletes the post by largest Id or all of the posts. So I will give you an idea of what I have... (this isn't my actual code, just an idea of it). </p>

<pre><code>       $result = mysql_query("SELECT * FROM post");

       while($row = mysql_fetch_array($result){


         $someVariable = $row['Id'];
         $someVariable1 = $row['title'];
         $someVariable2 = $row['content'];

?&gt;
        //This form right below here is the delete button. It functions, just need how to pull the correct Id***

        &lt;form action="" method="post"&gt;
       &lt;input type="submit" id ="&lt;?php echo $someVariable ?&gt;" value="" class="submit2" onClick="confirmation()"&gt;
    &lt;/form&gt;

    &lt;form action="" method="post"&gt;
      &lt;input type="submit" value="" class="submit3"&gt;
    &lt;/form&gt;

        &lt;script type="text/javascript"&gt;
       &lt;!--
        function confirmation() {
            var answer = confirm("Delete Post?")
            if (answer){

                &lt;?php 


                    mysql_query("DELETE FROM posts WHERE id=***"); 

                ?&gt;


            }

        }
       //--&gt;
       &lt;/script&gt;




&lt;?php }?&gt;
</code></pre>

<p>The function inside the Javascript is where the issue is. I can't seem to figure out how to get it to give back the right Id. I am fairly raw with php so be easy on me :p. </p>
