ADOdb returns column names and numeric indices

ADOdb fetchRowoutput:

Array
(
 [0] => ABC
    [NAME] => ABC
    [1] => 33
 [AGE] => 33
    [3] => M
 [GENDER] => M
    [4] => LA
 [CITY] => LA
    [5] => OH
 [STATE] => OH
)

How can I get only the index number:

Array 
(
 [0] => ABC
 [1] => 33
 [2] => M
 [3] => LA
 [4] => OH

) 

Or just an index name?

Array
(
    [NAME] => ABC
    [AGE] => 33
    [GENDER] => M
    [CITY] => LA
    [STATE] => OH
)
+3
source share
2 answers
  • Numeric indices - use $ connection-> SetFetchMode (ADODB_FETCH_NUM).

  • Associative indexes - array keys - these are field names (in upper case). Use $ connection-> SetFetchMode (ADODB_FETCH_ASSOC).

  • Both numeric and associative indexes - use $ connection-> SetFetchMode (ADODB_FETCH_BOTH).

The default is ADODB_FETCH_BOTH for Oracle.

+3
source

Respectively

$ADODB_FETCH_MODE = ADODB_FETCH_NUM;

and

$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;

From the manual:

, ADODB_FETCH_DEFAULT. , ADODB_FETCH_DEFAULT. ADODB_FETCH_NUM ADODB_FETCH_ASSOC. ADODB_FETCH_BOTH.

0

Source: https://habr.com/ru/post/1766210/