I have a list of buttons that can delete individual records from a database. This works!
A loop generates an array of buttons where the value is called to delete the record in the array according to a "for each" in a list. Works great! The delete button calls this function:
Quote:
if(isset($_POST['btnDelete'])) {
@$UpdateBTN= $_POST['btnDelete'];
while (list ($key, $val) = each ($UpdateBTN)){
$conVal = substr($val, 10);
$_SESSION['SaveNumber'] = $conVal;
mysql_query("DELETE FROM User_Selections WHERE SaveNumber = '" . $conVal . "'");
mysql_query("DELETE FROM User_Info WHERE SaveNumber = '" . $conVal . "'");
}
header("location: UserPage.php");
}
|
Now I want to be able to have a div window popup that will have yes and no as the choices. I have it working up to the point where the delete button in the loop makes the window visible and if you press no the window will become hidden.
But I want to have the yes button perform the same action as the delete button in the loop used to do. The problem, how can the yes button know which record to delete when it is in a separate div window outside the loop? Currently the above code is dependent on an array of buttons.