|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33656 Let PDO::query and PDO::exec accept $input_parameters
Submitted: 2005-07-12 12:04 UTC Modified: 2017-10-24 08:30 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned:
Status: Open Package: PDO related
PHP Version: 5.0.4 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-07-12 12:04 UTC]
It will be nice if PDO::query() and PDO::exec() would accept $input_parameters. I like to take advantage of variable binding and I am querying a database with just one set of parameters quite often so the current interface is not very friendly for me.

Reproduce code:
foreach ($pdo->query("SELECT name FROM test WHERE name LIKE ?", array($_GET["name"])) as $row) {
   echo "$row[name]\n";

Expected result:
List of names.

Actual result:
Currently, this code must be used:
$result = $pdo->prepare("SELECT name FROM test WHERE name LIKE ?");
foreach ($result as $row) {
   echo "$row[name]\n";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 22:59 UTC]
-Package: Feature/Change Request +Package: PDO Core
 [2017-10-24 08:30 UTC]
-Package: PDO Core +Package: PDO related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 17:01:28 2024 UTC