php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63884 Add fetching methods
Submitted: 2013-01-02 13:04 UTC Modified: 2021-04-07 12:03 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: vincent at lycoops dot be Assigned:
Status: Open Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
47 + 32 = ?
Subscribe to this entry?

 
 [2013-01-02 13:04 UTC] vincent at lycoops dot be
Description:
------------
I think it'd be great if there were a method like PDO's PDOStatement::fetch($fetch_style) method for mysqli_statement. Passing variables by reference is not always easy, espacially if you don't know how many fields are being selected or if you want to manipulate some fields. 

I (and a lot of people) use PDO only because mysqli is missing this feature, which exists in PDOStatement and mysqli_result.


I think the best way would be the following to be compatible with mysqli_result:
$statement->fetch_array(MYSQLI_ASSOC); (and all the other fetching methods)

Best regards
Vincent


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-07 12:03 UTC] cmb@php.net
Where is the problem with calling $statement->get_result(), and
fetch from the result set?

Ah, I see, this method is only implemented for mysqlnd.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 06:03:40 2021 UTC