note 94214 added to pdostatement.bindvalue
| From: | mikhail dot v dot gavrilov at gmail dot com | Date: | Thu, 22 Oct 2009 20:02:25 +0000 |
| Subject: | note 94214 added to pdostatement.bindvalue | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161990@lists.php.net to get a copy of this message | ||
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();
----
Server IP: 195.54.192.44
Probable Submitter: 77.79.176.3
----
Manual Page -- http://www.php.net/manual/en/pdostatement.bindvalue.php
Edit -- https://master.php.net/note/edit/94214
Del: integrated -- https://master.php.net/note/delete/94214/integrated
Del: useless -- https://master.php.net/note/delete/94214/useless
Del: bad code -- https://master.php.net/note/delete/94214/bad+code
Del: spam -- https://master.php.net/note/delete/94214/spam
Del: non-english -- https://master.php.net/note/delete/94214/non-english
Del: in docs -- https://master.php.net/note/delete/94214/in+docs
Del: other reasons-- https://master.php.net/note/delete/94214
Reject -- https://master.php.net/note/reject/94214
Search -- https://master.php.net/manage/user-notes.php