Generalize the use of killme()

- Add fail condition to q()
This commit is contained in:
Hypolite Petovan 2017-05-12 00:05:06 -04:00
commit 2cabf7f37b
3 changed files with 7 additions and 5 deletions

View file

@ -137,12 +137,16 @@ function q($sql)
$args = func_get_args();
unset($args[0]);
$ret = null;
if ($db) {
$ret = $db->q(vsprintf($sql, $args));
if ($db->db->errno) {
logger('dba: ' . $db->db->error);
}
} else {
error_log(__FILE__ . ':' . __LINE__ . ' $db has gone');
}
return $ret;