Salmons with Mastodon seem to work now

This commit is contained in:
Michael 2017-04-27 20:38:46 +00:00
parent 45d73b106b
commit 35dc56c9c2
8 changed files with 156 additions and 44 deletions

View file

@ -634,7 +634,29 @@ class dba {
if (is_bool($stmt)) {
$retval = $stmt;
} else {
$retval = (self::rows($stmt) > 0);
$retval = (self::num_rows($stmt) > 0);
}
self::close($stmt);
return $retval;
}
/**
* @brief Fetches the first row
*
* @param string $sql SQL statement
* @return array first row of query
*/
static public function fetch_first($sql) {
$args = func_get_args();
$stmt = call_user_func_array('self::p', $args);
if (is_bool($stmt)) {
$retval = $stmt;
} else {
$retval = self::fetch($stmt);
}
self::close($stmt);