|
function BeforeAdd(&$values)
{
//Parameters:
//$values - Array object.
// Each field on
the Add form is represented as a 'Field name'-'Field value' pair
//**********
Check to see if a specific record exists ************
global $conn;
$strSQLExists = "select
* from AnyTable where AnyColumn='AnyValue'";
$rsExists = db_query($strSQLExists,$conn);
$data = db_fetch_array($rsExists);
if($data)
{
//if record
exists do something
}
else
{
//if does not
exist - do something else
}
return true;
// return true if
you would like to proceed with adding the new record;
// return false otherwise
} |