2003-06-22 17:19:46 +00:00
|
|
|
--TEST--
|
2004-03-10 11:24:11 +00:00
|
|
|
sqlite-oo: Simple insert/select, different result representation
|
2003-06-22 17:19:46 +00:00
|
|
|
--INI--
|
|
|
|
sqlite.assoc_case=0
|
|
|
|
--SKIPIF--
|
|
|
|
<?php # vim:ft=php
|
|
|
|
if (!extension_loaded("sqlite")) print "skip"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
include "blankdb_oo.inc";
|
|
|
|
|
|
|
|
$db->query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))");
|
|
|
|
$db->query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)");
|
|
|
|
$r = $db->query("SELECT * from foo");
|
2004-03-26 21:16:50 +00:00
|
|
|
var_dump($r->fetch(SQLITE_BOTH));
|
2003-06-22 17:19:46 +00:00
|
|
|
$r = $db->query("SELECT * from foo");
|
2004-03-26 21:16:50 +00:00
|
|
|
var_dump($r->fetch(SQLITE_NUM));
|
2003-06-22 17:19:46 +00:00
|
|
|
$r = $db->query("SELECT * from foo");
|
2004-03-26 21:16:50 +00:00
|
|
|
var_dump($r->fetch(SQLITE_ASSOC));
|
2003-06-22 17:19:46 +00:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
array(6) {
|
|
|
|
[0]=>
|
|
|
|
string(10) "2002-01-02"
|
|
|
|
["c1"]=>
|
|
|
|
string(10) "2002-01-02"
|
|
|
|
[1]=>
|
|
|
|
string(8) "12:49:00"
|
|
|
|
["c2"]=>
|
|
|
|
string(8) "12:49:00"
|
|
|
|
[2]=>
|
|
|
|
NULL
|
|
|
|
["c3"]=>
|
|
|
|
NULL
|
|
|
|
}
|
|
|
|
array(3) {
|
|
|
|
[0]=>
|
|
|
|
string(10) "2002-01-02"
|
|
|
|
[1]=>
|
|
|
|
string(8) "12:49:00"
|
|
|
|
[2]=>
|
|
|
|
NULL
|
|
|
|
}
|
|
|
|
array(3) {
|
|
|
|
["c1"]=>
|
|
|
|
string(10) "2002-01-02"
|
|
|
|
["c2"]=>
|
|
|
|
string(8) "12:49:00"
|
|
|
|
["c3"]=>
|
|
|
|
NULL
|
|
|
|
}
|
2005-08-16 15:09:51 +00:00
|
|
|
--UEXPECT--
|
|
|
|
array(6) {
|
|
|
|
[0]=>
|
|
|
|
unicode(10) "2002-01-02"
|
|
|
|
[u"c1"]=>
|
|
|
|
unicode(10) "2002-01-02"
|
|
|
|
[1]=>
|
|
|
|
unicode(8) "12:49:00"
|
|
|
|
[u"c2"]=>
|
|
|
|
unicode(8) "12:49:00"
|
|
|
|
[2]=>
|
|
|
|
NULL
|
|
|
|
[u"c3"]=>
|
|
|
|
NULL
|
|
|
|
}
|
|
|
|
array(3) {
|
|
|
|
[0]=>
|
|
|
|
unicode(10) "2002-01-02"
|
|
|
|
[1]=>
|
|
|
|
unicode(8) "12:49:00"
|
|
|
|
[2]=>
|
|
|
|
NULL
|
|
|
|
}
|
|
|
|
array(3) {
|
|
|
|
[u"c1"]=>
|
|
|
|
unicode(10) "2002-01-02"
|
|
|
|
[u"c2"]=>
|
|
|
|
unicode(8) "12:49:00"
|
|
|
|
[u"c3"]=>
|
|
|
|
NULL
|
|
|
|
}
|