Gladius::fetch_mode
Previous  Next

public (int) Gladius::fetch_mode

Defines how rows are fetched back from resultsets; it can have the following values

GLADIUS_FETCH_NUM
Returned arrays have numerical progressive indices; this is a bit faster than the other alternatives.
Example:
Array
(
    [0] => Array
        (
            [0] => Giuseppe
            [1] => Albertini
            [2] => 0000-0001
        )
    [1] => Array
        (
            [0] => Gabriele
            [1] => D'Annunzio
            [2] => 1000-0000
        )

)

GLADIUS_FETCH_ASSOC
Returned arrays have field keys equal to column names
Example:
Array
(
    [0] => Array
        (
            [name] => Giuseppe
            [surname] => Albertini
            [phone] => 0000-0001
        )
    [1] => Array
        (
            [name] => Gabriele
            [surname] => D'Annunzio
            [phone] => 1000-0000
        )

)

GLADIUS_FETCH_BOTH
Returned arrays have both numerical and associative keys
Example:
Array
(
    [0] => Array
        (
            [0] => Giuseppe
            [1] => Albertini
            [2] => 0000-0001
            [name] => Giuseppe
            [surname] => Albertini
            [phone] => 0000-0001
        )
    [1] => Array
        (
            [0] => Gabriele
            [1] => D'Annunzio
            [2] => 1000-0000
            [name] => Gabriele
            [surname] => D'Annunzio
            [phone] => 1000-0000
        )

)

GLADIUS_FETCH_DEFAULT
Gladius default fetch mode is GLADIUS_FETCH_ASSOC