A little idea about pg_fetch_all ( resource result)
| From: | ing . Martin Prášek | Date: | Tue, 03 Feb 2004 16:09:18 +0000 |
| Subject: | A little idea about pg_fetch_all ( resource result) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-7509@lists.php.net to get a copy of this message | ||
In most databases an queries , there is primary key/unique constraint so i suggest to enhnace
function pg_fetch_all ( resource result)
to
pg_fetch_all ( resource result,[string key_column_name]) bz adding a second optional parameter, so
anybody can access all returned data like this:
$data= pg_fetch_all ($resource,$key_column_name]);
$column=$data['value of the key, specified in 2nd argument to pg_fetch_all' ]['name
of the column'];
ie all tuples/lines from result can be accessed via associative array, with key is the value of
specified column.
Yes, I think it can be done by wery simle code too, but....