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

« back to all changes in this revision

Viewing changes to ext/sqlite/tests/sqlite_oo_009.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-oo: fetch all (unbuffered)
 
3
--INI--
 
4
sqlite.assoc_case=0
 
5
--SKIPIF--
 
6
<?php # vim:ft=php
 
7
if (!extension_loaded("sqlite")) print "skip"; ?>
 
8
--FILE--
 
9
<?php 
 
10
include "blankdb_oo.inc";
 
11
 
 
12
$data = array(
 
13
        "one",
 
14
        "two",
 
15
        "three"
 
16
        );
 
17
 
 
18
$db->query("CREATE TABLE strings(a VARCHAR)");
 
19
 
 
20
foreach ($data as $str) {
 
21
        $db->query("INSERT INTO strings VALUES('$str')");
 
22
}
 
23
 
 
24
$r = $db->unbufferedQuery("SELECT a from strings");
 
25
while ($row = $r->fetch(SQLITE_NUM)) {
 
26
        var_dump($row);
 
27
}
 
28
echo "DONE!\n";
 
29
?>
 
30
--EXPECT--
 
31
array(1) {
 
32
  [0]=>
 
33
  string(3) "one"
 
34
}
 
35
array(1) {
 
36
  [0]=>
 
37
  string(3) "two"
 
38
}
 
39
array(1) {
 
40
  [0]=>
 
41
  string(5) "three"
 
42
}
 
43
DONE!