Confirm reject button

Hello,
Is there a way to add a confirm or reject button on phpmaker? I have a table for pending application so that instead of editing the table it the data would be inserted into another table if you press confirm or deleted from the current table if it is rejected. I am thinking of modifying the rendered page_edit and substitute the form action. My php script is like this
$fullname = $_POST[‘fullname’];
$date = $_POST[‘date’];
$email = $_POST[‘email’];
$contact = $_POST[‘contact’];
$altcontact = $_POST[‘altcontact’];
$address = $_POST[‘address’];

$query = “INSERT INTO volunteer (fullname,date,email,contact,altcontact,address) VALUES (‘$fullname’,‘$date’,‘$email’,‘$contact’,‘$altcontact’,‘$address’)”;
$query_run = mysqli_query($connection, $query);

if($query_run)
{
$_SESSION[‘success’] = “Your Pending Volunteer has been confirmed.”;
header(‘Location: pending-volunteers.php’);
}
else
{
$_SESSION[‘status’] = “Your Pending Volunteer has not been confirmed, Please try again.”;
header(‘Location: pending-volunteers.php’);
}

Thanks a lot

You may use Row_Updating server event, see the topic Server Events and Client Scripts in the help file.

// Row Updated event
function Row_Updated($rsold, &$rsnew) {
//echo “Row Updated”;
Execute(“INSERT INTO volunteer(fullname, date, email, contact, altcontact, address) VALUES ('” . $rsold[“fullname”] . “', '” . $rsold[“date”] . “', '” . $rsold[“email”] . “', '” . $rsold[“contact”] . “', '” . $rsold[“altcontact”] . “', '” . $rsold[“address”] . “')”);
Execute("DELETE FROM pendingvolunteer WHERE id = " . $rsold[“id”]);
return TRUE;
}

this are the script but it does’t delete the old record

arbei wrote:

You may use Row_Updating server event, see the topic Server Events and Client Scripts in the help file.

If you want to return TRUE/FALSE to accept/reject updating, you need to use Row_Updating, not Row_Updated.

If the first (INSERT) statement fails, the script halts and the second statement (DELETE) cannot be executed. You may debug by, e.g.

echo “INSERT INTO volunteer(fullname, date, email, contact, altcontact, address) VALUES ('” . $rsold[“fullname”] . “', '” . $rsold[“date”] . “', '” . $rsold[“email”] . “', '” . $rsold[“contact”] . “', '” . $rsold[“altcontact”] . “', '” . $rsold[“address”] . “')”;
echo "DELETE FROM pendingvolunteer WHERE id = " . $rsold[“id”];
die();

Then test your INSERT/DELETE statements in your MySQL manager first.