#44757 [NEW]: use sql-id as key
| From: | nobs at nobswolf dot info | Date: | Thu, 17 Apr 2008 12:24:33 +0000 |
| Subject: | #44757 [NEW]: use sql-id as key | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-124320@lists.php.net to get a copy of this message | ||
From: nobs at nobswolf dot info
Operating system:
PHP version: 5.2.5
PHP Bug Type: Feature/Change Request
Bug description: use sql-id as key
Description:
------------
Let functions like pg_fetch_all use one column of the result set (most
likely the primary key or another unique key) as key of the PHP-array.
Reproduce code:
---------------
// this is what I currently use
$ergebnis= pg_fetch_all($resultset);
foreach ($ergebnis as $row){
$text[$row['id']] = $row['text'];
}
// this is what I would like to have
$textA= pg_fetch_all($resultset, 'id');
// just for convenience, readability and performance
--
Edit bug report at http://bugs.php.net/?id=44757&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44757&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44757&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44757&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44757&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44757&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44757&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44757&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44757&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44757&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44757&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44757&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44757&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44757&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44757&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44757&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44757&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44757&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44757&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44757&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44757&r=mysqlcfg