you get an error saying that foreign key integrity has been violated, and the insert fails
note you can catch the error in php and issue your own user-friendly error message (but don’t ask me how to do that, as i don’t do php)[/quote]
Can someone help me figure this one out?
Since I use Prepared Statements, would I capture it like below…
// Verify Insert.
if (mysqli_stmt_affected_rows($stmt3)==1){
// Insert Succeeded.
do something...
}else{
// Insert Failed.
$_SESSION['resultsCode'] = 'ACCOUNT_MEMBER_ACCT_FAILED_2103';
}// End of VERIFY INSERT.
// Close prepared statement.
mysqli_stmt_close($stmt2);
// Set Error Source.
$_SESSION['errorPage'] = $_SERVER['SCRIPT_NAME'];
// Redirect to Display Outcome.
header("Location: " . BASE_URL . "/account/results.php");
// End script.
exit();
}else{
// Invalid form data.
// Drop through to display Form.
}//End of ATTEMPT TO CREATE MEMBER
Thanks,
Debbie