1--TEST--
2odbc_fetch_row(): 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_row (test INT)');
15
16odbc_exec($conn, 'INSERT INTO fetch_row VALUES (1), (2)');
17
18$res = odbc_exec($conn, 'SELECT * FROM fetch_row');
19
20var_dump(odbc_fetch_row($res, 0));
21
22var_dump(odbc_fetch_row($res, null));
23var_dump(odbc_result($res, 'test'));
24
25var_dump(odbc_fetch_row($res, null));
26var_dump(odbc_result($res, 'test'));
27
28var_dump(odbc_fetch_row($res, 2));
29var_dump(odbc_result($res, 'test'));
30
31var_dump(odbc_fetch_row($res, 4));
32
33odbc_free_result($res);
34odbc_close($conn);
35?>
36--CLEAN--
37<?php
38require 'config.inc';
39$conn = odbc_connect($dsn, $user, $pass);
40odbc_exec($conn, 'DROP TABLE fetch_row');
41?>
42--EXPECTF--
43bool(false)
44bool(true)
45string(1) "1"
46bool(true)
47string(1) "2"
48bool(true)
49string(1) "2"
50bool(false)
51