xref: /php-src/ext/odbc/tests/odbc_exec_002.phpt (revision 8726ae06)
1--TEST--
2odbc_exec(): 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 exec2 (TEST INT)');
15odbc_exec($conn, 'INSERT INTO exec2 VALUES (1), (2)');
16
17$res = odbc_exec($conn, 'SELECT * FROM exec2');
18
19var_dump(odbc_fetch_row($res));
20var_dump(odbc_result($res, 'test'));
21var_dump(odbc_fetch_array($res));
22?>
23--CLEAN--
24<?php
25require 'config.inc';
26$conn = odbc_connect($dsn, $user, $pass);
27odbc_exec($conn, 'DROP TABLE exec2');
28?>
29--EXPECT--
30bool(true)
31string(1) "1"
32array(1) {
33  ["TEST"]=>
34  string(1) "2"
35}
36