Delte record from db
<p>Can i delete a record using the following function? If yes how can i do this? I have to pass the function to the submit button? </p>

<pre><code>function deleteImage($id = "")
        {
            if(isset($_POST['delete_image']))
            {
                $query = mysql_query("DELETE FROM store WHERE id='$id'");
            }
               return $query;

        }
</code></pre>

<p>the html looks like this:</p>

<pre><code>&lt;?php

   $images = mysql_query("SELECT * FROM store");

   while($row = mysql_fetch_assoc($images)) {
?&gt;
        &lt;form action="admin.php" method="post"&gt;
            &lt;?php 
                echo "&lt;img src=".$row['image']."&gt;"; 
            ?&gt;
            &lt;input type="submit" name="delete_image" value="DELETE IMAGE"&gt;
        &lt;/form&gt;
&lt;?php       
   }
?&gt;
</code></pre>

<p>Thanks in advance!</p>
