1--TEST--
2odbc_fetch_into(): Getting data from query
3--EXTENSIONS--
4odbc
5--SKIPIF--
6<?php include 'skipif.inc'; ?>
7--FILE--
8<?php
9
10include 'config.inc';
11
12$conn = odbc_connect($dsn, $user, $pass);
13
14odbc_exec($conn, 'CREATE TABLE fetch_into (foo INT)');
15odbc_exec($conn, 'INSERT INTO fetch_into VALUES (1), (2)');
16
17$res = odbc_exec($conn, 'SELECT * FROM fetch_into');
18
19$arr = [];
20var_dump(odbc_fetch_into($res, $arr));
21var_dump($arr);
22$arr = [];
23var_dump(odbc_fetch_into($res, $arr, 0));
24var_dump($arr);
25$arr = [];
26var_dump(odbc_fetch_into($res, $arr, 2));
27var_dump($arr);
28$arr = [];
29var_dump(odbc_fetch_into($res, $arr, 4));
30var_dump($arr);
31
32?>
33--CLEAN--
34<?php
35require 'config.inc';
36$conn = odbc_connect($dsn, $user, $pass);
37odbc_exec($conn, 'DROP TABLE fetch_into');
38?>
39--EXPECTF--
40int(1)
41array(1) {
42  [0]=>
43  string(1) "1"
44}
45int(1)
46array(1) {
47  [0]=>
48  string(1) "2"
49}
50int(1)
51array(1) {
52  [0]=>
53  string(1) "2"
54}
55bool(false)
56array(0) {
57}
58