queryRaw() will now be officially supported, returns mysqli_result instead of array of assoc
arrays
This commit is contained in:
@@ -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'); }
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user