xref: /PHP-5.3/ext/sqlite/tests/sqlite_oo_012.phpt (revision 610c7fbe)
1--TEST--
2sqlite-oo: read field names
3--INI--
4sqlite.assoc_case=0
5--SKIPIF--
6<?php # vim:ft=php
7if (!extension_loaded("sqlite")) print "skip"; ?>
8--FILE--
9<?php
10include "blankdb_oo.inc";
11
12$db->query("CREATE TABLE strings(foo VARCHAR, bar VARCHAR, baz VARCHAR)");
13
14echo "Buffered\n";
15$r = $db->query("SELECT * from strings");
16for($i=0; $i<$r->numFields(); $i++) {
17	var_dump($r->fieldName($i));
18}
19echo "Unbuffered\n";
20$r = $db->unbufferedQuery("SELECT * from strings");
21for($i=0; $i<$r->numFields(); $i++) {
22	var_dump($r->fieldName($i));
23}
24echo "DONE!\n";
25?>
26--EXPECT--
27Buffered
28string(3) "foo"
29string(3) "bar"
30string(3) "baz"
31Unbuffered
32string(3) "foo"
33string(3) "bar"
34string(3) "baz"
35DONE!
36