-
Notifications
You must be signed in to change notification settings - Fork 8k
Expand file tree
/
Copy pathodbc_fetch_into_001.phpt
More file actions
57 lines (51 loc) · 941 Bytes
/
odbc_fetch_into_001.phpt
File metadata and controls
57 lines (51 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--TEST--
odbc_fetch_into(): Getting data from query
--EXTENSIONS--
odbc
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
include 'config.inc';
$conn = odbc_connect($dsn, $user, $pass);
odbc_exec($conn, 'CREATE TABLE fetch_into (foo INT)');
odbc_exec($conn, 'INSERT INTO fetch_into VALUES (1), (2)');
$res = odbc_exec($conn, 'SELECT * FROM fetch_into');
$arr = [];
var_dump(odbc_fetch_into($res, $arr));
var_dump($arr);
$arr = [];
var_dump(odbc_fetch_into($res, $arr, null));
var_dump($arr);
$arr = [];
var_dump(odbc_fetch_into($res, $arr, 2));
var_dump($arr);
$arr = [];
var_dump(odbc_fetch_into($res, $arr, 4));
var_dump($arr);
?>
--CLEAN--
<?php
require 'config.inc';
$conn = odbc_connect($dsn, $user, $pass);
odbc_exec($conn, 'DROP TABLE fetch_into');
?>
--EXPECTF--
int(1)
array(1) {
[0]=>
string(1) "1"
}
int(1)
array(1) {
[0]=>
string(1) "2"
}
int(1)
array(1) {
[0]=>
string(1) "2"
}
bool(false)
array(0) {
}