summaryrefslogtreecommitdiff
path: root/ext/sqlite/tests/sqlite_oo_003.phpt
blob: f49803893636545f8bd9d21b825f3a9017e082b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--TEST--
sqlite-oo: Simple insert/select, different result represenatation
--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");
var_dump($r->fetch_array(SQLITE_BOTH));
$r = $db->query("SELECT * from foo");
var_dump($r->fetch_array(SQLITE_NUM));
$r = $db->query("SELECT * from foo");
var_dump($r->fetch_array(SQLITE_ASSOC));
?>
--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
}