PHP Code:
function account_before_save(&$bean, $event, $arguments){
$cid = mysql_connect($host,$usr,$pwd);
$SQL = " SELECT * FROM accounts_cstm where id_c = '" . str_replace("'", "''", $bean->account_number_c) . "'";
$retid = mysql_db_query($db, $SQL, $cid);
if ($row = mysql_fetch_array($retid)) {
if($bean->account_number_c != $row["id_cl"]){
//there is another account with the same
echo "error";
exit;
}
}
}
How do I get an error message to display back to the screen with the submitted fields still intact? Is there an easy way? Thanks in advance!
Bookmarks