confirmation about deleting a record from database
<p>I am using php and javascript. I want to delete a record from database after a giving "Yes" and "No" confirmation to user. I am using confirmbox by google but don't know what should be my code structure inside that. I am new to programing. Can any one help me please</p>

<p>How can I add this php function on javascript</p>

<pre><code>function deleteRecord($id)
{
  $sql = "DELETE FROM user_database WHERE user_id = ".$id;
  mysql_query($sql) or die("Can not delete");
}
</code></pre>

<p>And on page</p>

<pre><code>&lt;script type="text/javascript"&gt;
function show_confirm()
{
var r=confirm("Press a button!");
if (r==true)
  {
  alert("You pressed OK!");
  }
else
  {
  alert("You pressed Cancel!");
  }
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;input type="button" onclick="show_confirm()" value="Show a confirm box" /&gt;
</code></pre>
