Req #60311 [Opn->Wfx]: Allow multiple arguments instead of array
| From: | yohgaki@php.net | Date: | Wed, 23 Nov 2011 03:03:38 +0000 |
| Subject: | Req #60311 [Opn->Wfx]: Allow multiple arguments instead of array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165441@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60311&edit=1
ID: 60311
Updated by: yohgaki@php.net
Reported by: olafvdspek at gmail dot com
Summary: Allow multiple arguments instead of array
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: PostgreSQL related
Operating System: *
PHP Version: 5.4.0RC1
Block user comment: N
Private report: N
New Comment:
I understand your idea, I hate to pass arrays also.
However, PHP 5.4 allows short hand array notation (i.e. []), so you can do it as
follows.
$result = pg_query_params($dbconn, 'SELECT * FROM shops WHERE name = $1 and age
= $2', ["Joe's Widgets", 42]);
Just a 2 chars from PHP 5.4! Isn't great?
So I will not implement this.
Previous Comments:
------------------------------------------------------------------------
[2011-11-16 10:59:38] olafvdspek at gmail dot com
Description:
------------
This is a great function, but it could be even simpler. Is it possible to use
multiple arguments instead of the array? See the test script.
http://php.net/manual/en/function.pg-query-params.php
Test script:
---------------
$result = pg_query_params($dbconn, 'SELECT * FROM shops WHERE name = $1 and age = $2',
array("Joe's Widgets", 42));
$result = pg_query_params($dbconn, 'SELECT * FROM shops WHERE name = $1 and age = $2',
"Joe's Widgets", 42);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60311&edit=1