diff --git a/db.class.php b/db.class.php index a03f6a3..080a603 100644 --- a/db.class.php +++ b/db.class.php @@ -357,6 +357,7 @@ class DB } public static function queryNull() { $args = func_get_args(); return DB::prependCall('DB::queryHelper', $args, 'null'); } + public static function queryRaw() { $args = func_get_args(); return DB::prependCall('DB::queryHelper', $args, 'buffered'); } public static function queryBuf() { $args = func_get_args(); return DB::prependCall('DB::queryHelper', $args, 'buffered'); } public static function queryUnbuf() { $args = func_get_args(); return DB::prependCall('DB::queryHelper', $args, 'unbuffered'); } diff --git a/simpletest/BasicTest.php b/simpletest/BasicTest.php index 201113f..da92559 100644 --- a/simpletest/BasicTest.php +++ b/simpletest/BasicTest.php @@ -97,6 +97,12 @@ class BasicTest extends SimpleTest { $this->assert($username === 'Bart'); $this->assert($password === 'hello'); $this->assert($age == 15); + + $mysqli_result = DB::queryRaw("SELECT * FROM accounts WHERE favorite_word IS NULL"); + $this->assert($mysqli_result instanceof MySQLi_Result); + $row = $mysqli_result->fetch_assoc(); + $this->assert($row['password'] === 'goodbye'); + $this->assert($mysqli_result->fetch_assoc() === null); } function test_4_query() {