note 94214 rejected from pdostatement.bindvalue by danbrown
| From: | danbrown@php.net | Date: | Thu, 22 Oct 2009 21:53:09 +0000 |
| Subject: | note 94214 rejected from pdostatement.bindvalue by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161992@lists.php.net to get a copy of this message | ||
Note Submitter: mikhail dot v dot gavrilov at gmail dot com
----
Feature request.
Need a function to obtain a list of 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();