Generalize the use of killme()
- Add fail condition to q()
This commit is contained in:
parent
381e68edc7
commit
2cabf7f37b
3 changed files with 7 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue