extendinf a query

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
rob parsons
Posts: 8
Joined: 2014-10-31 20:11

extendinf a query

Post by rob parsons » 2014-11-28 17:30

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;
}

Post Reply