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