PDO returns 'false' for no rows, but various parts of the code expect it to return 'null'; for now, emulate the old behaviour

This commit is contained in:
Shish 2011-03-24 14:27:11 +00:00
parent ae17700a30
commit 1abb96159b

View File

@ -359,7 +359,8 @@ class Database {
* Execute an SQL query and return a single row
*/
public function get_row($query, $args=array()) {
return $this->execute($query, $args)->fetch();
$row = $this->execute($query, $args)->fetch();
return $row ? $row : null;
}
/**