Fix "Object of class SQLite3Result could not be converted to int" within includes/database.class.php