Delete record 'friendly' message
Is there any way to display a 'friendly' message about restricting deletion of a record in a parent table if there are dependent records in the child table? Using InnoDB tables.
Would I have to code this myself or is there something in Data Bridge I can use?
I would need to use it with the DataAssist 'Multiple record delete' SB
I don't want people to be presented with a mysql message >>
"Cannot delete or update a parent row: a foreign key constraint fails ... "
Rather: "This record has dependent records. Can't be deleted" then redirect.
Also I need a CANCEL button, so I put the following code just above the 'WA DataAssist Multiple Deletes' code block:
*************************************
<?php if (array_key_exists('Cancel', $_POST)) {
header('Location: redirect.php');
exit;
}
?>
*************************************
but this does not work. I've used it countless times using the Dreamweaver 'Delete record' SB.
Cheers
Dave