Req #75486 [NEW]: Additional PDO::FETCH_GROUP combinations
| From: | andrew at fw dot net dot nz | Date: | Sun, 05 Nov 2017 17:46:16 +0000 |
| Subject: | Req #75486 [NEW]: Additional PDO::FETCH_GROUP combinations | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212469@lists.php.net to get a copy of this message | ||
From: andrew at fw dot net dot nz
Operating system:
PHP version: Irrelevant
Package: PDO related
Bug Type: Feature/Change Request
Bug description:Additional PDO::FETCH_GROUP combinations
Description:
------------
Two proposed PDO fetch combinations I think would be sensible (I've
actually tried to use these on occasion, assuming they would work).
---
1. PDO::FETCH_GROUP | PDO::FETCH_KEY_PAIR
Same as FETCH_KEY_PAIR but organised into groups. The first column would
be the group, the second the key and the third the value. E.g.:
[
'group1'=>[
'key1'=>'val1',
'key2'=>'val2'
],
'group2'=>[
...
]
]
Currently this combination appears to ignore FETCH_GROUP and gives
identical results as FETCH_KEY_PAIR by itself, despite the documentation
for FETCH_GROUP indicating that it can be combined with FETCH_KEY_PAIR.
See also https://bugs.php.net/bug.php?id=63813.
---
2. PDO::FETCH_GROUP | PDO::FETCH_UNIQUE
Same as FETCH_UNIQUE but organised into groups. The first column would
be the group, the second the unique key. E.g.:
[
'group1'=>[
'key1'=>['col3'=>'val',
'col4'=>'val', ...],
'key2'=>['col3'=>'val',
'col4'=>'val', ...]
],
'group2'=>[
...
]
]
Currently this combination appears to ignore FETCH_GROUP and gives
identical results as FETCH_UNIQUE by itself, as
PDO::FETCH_GROUP|PDO::FETCH_UNIQUE === PDO::FETCH_UNIQUE.
---
There may be BC issues with implementing these if people are currently
using these combinations believing they are achieving something
(https://stackoverflow.com/a/22063422).
--
Edit bug report at https://bugs.php.net/bug.php?id=75486&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75486&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75486&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75486&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75486&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75486&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75486&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75486&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75486&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75486&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75486&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75486&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75486&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75486&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75486&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75486&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75486&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75486&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75486&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75486&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75486&r=mysqlcfg