File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
reference/pdo/pdostatement Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 5454 <parameter >column</parameter > parameter.
5555 </para >
5656 <para >
57- To fetch only the unique values of a single column from the result set,
58- bitwise-OR <constant >PDO::FETCH_COLUMN</constant > with
59- <constant >PDO::FETCH_UNIQUE</constant >.
57+ To index the resulting array by a certain column's value (instead of
58+ consecutive numbers), put this column's name first in the column
59+ list in SQL, and use <constant >PDO::FETCH_UNIQUE</constant >.
60+ This column must contain only unique values or some data will be lost.
6061 </para >
6162 <para >
62- To return an associative array grouped by the values of a specified
63- column, bitwise-OR <constant >PDO::FETCH_COLUMN</constant > with
64- <constant >PDO::FETCH_GROUP</constant >.
63+ To group results in the form of a 3-dimensional array indexed by values
64+ of a specified column, put this column's name first in
65+ the column list in SQL and use <constant >PDO::FETCH_GROUP</constant >.
66+ </para >
67+ <para >
68+ To group results in the form of a 2-dimensional array
69+ use bitwise-OR <constant >PDO::FETCH_GROUP</constant > with
70+ <constant >PDO::FETCH_COLUMN</constant >.
71+ The results will be grouped by the first column, with the array element's value
72+ being a list array of the corresponding entries from the second column.
6573 </para >
6674 </listitem >
6775 </varlistentry >
You can’t perform that action at this time.
0 commit comments