|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-30 22:59 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: PDO Core
[2017-10-24 08:30 UTC] kalle@php.net
-Package: PDO Core
+Package: PDO related
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ 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: --------------- <?php 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: <?php $result = $pdo->prepare("SELECT name FROM test WHERE name LIKE ?"); $result->execute(array($_GET["name"])); foreach ($result as $row) { echo "$row[name]\n"; } ?>