|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44757 use sql-id as key
Submitted: 2008-04-17 12:24 UTC Modified: 2017-10-24 07:58 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: nobs at nobswolf dot info Assigned:
Status: Open Package: PostgreSQL related
PHP Version: 5.2.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
35 - 32 = ?
Subscribe to this entry?

 [2008-04-17 12:24 UTC] nobs at nobswolf dot info
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-22 13:42 UTC]
-Package: Feature/Change Request +Package: PostgreSQL related
 [2012-03-31 05:39 UTC]
-Assigned To: +Assigned To: yohgaki
 [2017-10-24 07:58 UTC]
-Status: Assigned +Status: Open -Assigned To: yohgaki +Assigned To:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 03:05:52 2023 UTC