1--TEST-- 2odbc_fetch_array(): 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_array (foo INT)'); 15odbc_exec($conn, 'INSERT INTO fetch_array VALUES (1), (2)'); 16 17$res = odbc_exec($conn, 'SELECT * FROM fetch_array'); 18 19var_dump(odbc_fetch_array($res)); 20var_dump(odbc_fetch_array($res, 0)); 21var_dump(odbc_fetch_array($res, 2)); 22var_dump(odbc_fetch_array($res, 4)); 23 24?> 25--CLEAN-- 26<?php 27require 'config.inc'; 28$conn = odbc_connect($dsn, $user, $pass); 29odbc_exec($conn, 'DROP TABLE fetch_array'); 30?> 31--EXPECTF-- 32array(1) { 33 ["foo"]=> 34 string(1) "1" 35} 36array(1) { 37 ["foo"]=> 38 string(1) "2" 39} 40array(1) { 41 ["foo"]=> 42 string(1) "2" 43} 44bool(false) 45