php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63799 Make interface for prepared statements easier
Submitted: 2012-12-18 21:27 UTC Modified: 2021-07-20 11:01 UTC
Votes:5
Avg. Score:3.0 ± 1.3
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: thbley at gmail dot com Assigned: cmb (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.5.0alpha1 OS: win7 x64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: thbley at gmail dot com
New email:
PHP Version: OS:

 

 [2012-12-18 21:27 UTC] thbley at gmail dot com
Description:
------------
Please offer an easier interface to run prepared statements, e.g.

$db = new mysqli_db('127.0.0.1', 'root', 'some_pw', 'test');

foreach ($db->query('select * from bla where someint=? and somechar=?', MYSQLI_STORE_RESULT, [10, 'hello_world']) as $row) {...}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-18 21:29 UTC] thbley at gmail dot com
or sprintf-style instead of auto-detection:

foreach ($db->query('select * from bla where someint=%d and somechar=%s', MYSQLI_STORE_RESULT, [10, 'hello_world']) as $row) {...}
 [2021-07-20 11:01 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-07-20 11:01 UTC] cmb@php.net
This is basically available as of PHP 8.1.0[1]; well, it's still a
two step process (::prepare() and ::execute()), but that should be
a sufficient improvement.

[1] <https://wiki.php.net/rfc/mysqli_bind_in_execute>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 07:01:31 2025 UTC