php-src/ext/sqlite/tests/sqlite_oo_016.phpt
2005-08-16 15:09:51 +00:00

51 lines
958 B
PHP
Executable File

--TEST--
sqlite-oo: fetch single
--INI--
sqlite.assoc_case=0
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("sqlite")) print "skip"; ?>
--FILE--
<?php
include "blankdb_oo.inc";
$data = array(
array (0 => 'one', 1 => 'two'),
array (0 => 'three', 1 => 'four')
);
$db->query("CREATE TABLE strings(a VARCHAR, b VARCHAR)");
foreach ($data as $str) {
$db->query("INSERT INTO strings VALUES('${str[0]}','${str[1]}')");
}
echo "====BUFFERED====\n";
$r = $db->query("SELECT a, b from strings");
while ($r->valid()) {
var_dump($r->fetchSingle());
}
echo "====UNBUFFERED====\n";
$r = $db->unbufferedQuery("SELECT a, b from strings");
while ($r->valid()) {
var_dump($r->fetchSingle());
}
echo "DONE!\n";
?>
--EXPECT--
====BUFFERED====
string(3) "one"
string(5) "three"
====UNBUFFERED====
string(3) "one"
string(5) "three"
DONE!
--UEXPECT--
====BUFFERED====
unicode(3) "one"
unicode(5) "three"
====UNBUFFERED====
unicode(3) "one"
unicode(5) "three"
DONE!