Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

PDO_FETCH_BOTH / PDO::FETCH_NUM

posted by theyouyou 8 years ago

Hello,

Is it possible to switch the fResult:fetch() mode to PDO's PDO_FETCH_BOTH / PDO::FETCH_NUM ?
I'd like to get arrays with column number as key.

I currently don't do this because it is brittle. With the ability to drop columns and add column in the middle of a table, the number a column is in a result can change, causing weird side-effects. You can always pass the array through array_values() if you want to strip the keys off.

posted by wbond 8 years ago

Thanks. the array_values() did the trick for my old project compatibility purposes.

posted by theyouyou 8 years ago