php.net |  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
Votes:2
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nobs at nobswolf dot info
New email:
PHP Version: OS:

 

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-22 13:42 UTC] johannes@php.net
-Package: Feature/Change Request +Package: PostgreSQL related
 [2012-03-31 05:39 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2017-10-24 07:58 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: yohgaki +Assigned To:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC