. "WHERE sys_group_mask.gid = %d AND fname = %s",
$_SESSION['sys']['group'], $db->quote($form));
- $sth = $db->query($sql);
-
- if ($sth === false) {
- error_log('Unauthorised access to ' . $form);
- return false;
- }
+ $count = $db->fetchValue($sql);
- $row = $sth->fetch();
- if ($row === false) {
+ if ($count === false) {
error_log('Unauthorised access to ' . $form);
return false;
}
- if ($row['count'] == 0) {
+ if ($count == 0) {
error_log('Unauthorised access to ' . $form);
return false;
}