I have a delete form wherein the user will enter the pnum to be deleted and then it will delete the corresponding record. But I want the user to atleast see what would be deleted so I tried this code, but it doesnt seem to work:
<?php
$con = mysql_connect("localhost","root","nitoryolai123$%^");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("Hospital", $con);
$result = mysql_query("SELECT * FROM t2 WHERE PNUM='{$_POST["pnum"]}'");
?>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form action="DeletebyPnumIn.php" method="post" onSubmit="return confirm('Are you sure you want to delete "<?php echo $row["LASTNAME"]; ?>" )">
what might be the correct way of doing this?