Using an adaptapion of the pasted code. I need to check for TWO fields, and keep hitting errors, please give pointers how to add AND to the WHere statement
function ARC_status_before_insert(&$data, $memberInfo, &$args){
$b_return = true;
// only one ARC_status allowed for an ARC_request
if ($data['sts_req_id'] != "") {
// count the linked ARC_requests
$sql_string = "SELECT ifnull(count(*),0)
FROM ARC_status
WHERE sts_req_id = " . $data['sts_req_id'] . ";";
$countARCrequest = sqlValue($sql_string, $o);
if ($countARCrequest != 0) {
// insert NOT allowed
$b_return = false;
}
}
return $b_return;
}