PDO statement uses the setfetchmode() method to set the default fetch mode.
PDOStatement::setFetchMode($mode)
$mode: mode is a valid value pass to fetch() method.
Some of the commonly used fetching modes are:
PDO::FETCH_ASSOC:
returns the associative array indexed by column name.
PDO::FETCH_BOTH (default):
return both the associative and numeric array.
PDO::FETCH_NUM:
return the numeric array.
PDO::FETCH_OBJ:
returns as an object
0 Comment(s)