ID: 49963
User updated by: mikhail dot v dot gavrilov at gmail dot com
Reported By: mikhail dot v dot gavrilov at gmail dot com
Status: Open
Bug Type: Feature/Change Request
PHP Version: 5.3.0
New Comment:
Here new function is getParameters().
This function return array with needed for bind parameters.
Previous Comments:
------------------------------------------------------------------------
[2009-10-23 02:01:45] mikhail dot v dot gavrilov at gmail dot com
Description:
------------
Feature request.
Need a function to obtain a list of PDO query parameters. To be able to
universal queries without the need to create an individual code for each
request with bindValue functions.
Example:
$sth = $GLOBALS['db']['conn']->prepare($query);
$bindpars = $sth->getParameters();
foreach ($bindpars as $idx => $value)
if(isset($_POST[substr($idx, 1)])) $sth->bindValue($idx,
$_POST[substr($idx, 1)]); else $sth->bindValue($idx, '');
$sth->execute();
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49963&edit=1