~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/sqlite/tests/sqlite_007.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
sqlite: Simple insert/select (unbuffered)
 
3
--INI--
 
4
sqlite.assoc_case=0
 
5
--SKIPIF--
 
6
<?php
 
7
if (!extension_loaded("sqlite")) print "skip"; ?>
 
8
--FILE--
 
9
<?php 
 
10
include "blankdb.inc";
 
11
 
 
12
sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db);
 
13
sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db);
 
14
$r = sqlite_unbuffered_query("SELECT * from foo", $db);
 
15
var_dump(sqlite_fetch_array($r, SQLITE_BOTH));
 
16
$r = sqlite_unbuffered_query("SELECT * from foo", $db);
 
17
var_dump(sqlite_fetch_array($r, SQLITE_NUM));
 
18
$r = sqlite_unbuffered_query("SELECT * from foo", $db);
 
19
var_dump(sqlite_fetch_array($r, SQLITE_ASSOC));
 
20
sqlite_close($db);
 
21
?>
 
22
--EXPECT--
 
23
array(6) {
 
24
  [0]=>
 
25
  string(10) "2002-01-02"
 
26
  ["c1"]=>
 
27
  string(10) "2002-01-02"
 
28
  [1]=>
 
29
  string(8) "12:49:00"
 
30
  ["c2"]=>
 
31
  string(8) "12:49:00"
 
32
  [2]=>
 
33
  NULL
 
34
  ["c3"]=>
 
35
  NULL
 
36
}
 
37
array(3) {
 
38
  [0]=>
 
39
  string(10) "2002-01-02"
 
40
  [1]=>
 
41
  string(8) "12:49:00"
 
42
  [2]=>
 
43
  NULL
 
44
}
 
45
array(3) {
 
46
  ["c1"]=>
 
47
  string(10) "2002-01-02"
 
48
  ["c2"]=>
 
49
  string(8) "12:49:00"
 
50
  ["c3"]=>
 
51
  NULL
 
52
}