Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4322294
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:51:18+00:00 2026-05-21T08:51:18+00:00

When querying using mysqli_stmt::prepare() and execute() , it will not return the result set.

  • 0

When querying using mysqli_stmt::prepare() and execute(), it will not return the result set. But we need to access using the mysqli_stmt:fetch() on the stmt object. There is one function in the php manual called mysqli_stmt::get_result() that will return the result set into a variable we define, but when I use it, it gives me undefined method error. The manual say it is probably in SVC which I am not sure what.

The codes:

$conn = new mysqli(DB_HOST,DB_USERNAME,DB_PASSWORD, DB_NAME);
$stmt =  $conn->stmt_init();
$stmt->prepare("select * from users where u_id = ? ");
$stmt->bind_param('s', $param);
$stmt->execute();

Edit :
I know I can use bind_result() and fetch() function to retrieve the record like :

$stmt->bind_result($column1, $column2, $column3);

while ($stmt->fetch()) {
    echo "Column 1: $column1\n";
    echo "Column 2: $column2\n";
    echo "Column 3: $column3\n";
}

But, my objective is to get the result set (the resource type object) after I execute, something like this:

$result = $stmt->execute();

so I can use the normal mysqli::fetch_object on the result set

$conn->fetch_object($result);

Is there any way to achieve this? thanks

Update:
The get_result function is exactly what I need, but it’s not working on my PHP

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:51:19+00:00Added an answer on May 21, 2026 at 8:51 am

    Well, if you do not want to use mysqli_stmt::fetch() but mysqli_result::fetch_*(), I guess it will be a little cumbersome.

    http://www.joekolba.com/node/2

    Alternatively, use PDO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In PHP, which is quicker; using include('somefile.php') or querying a MySQL database with a
I have recently written a dynamic querying tool using expression trees and as I
I'm querying a bunch of information from cisco switches using SNMP. For instance, I'm
Hi there im using a single TextBox for querying differents types of chossings, for
Here's what I'm trying to do. I'm querying an XML file using LINQ to
I am querying data from views that are subject to change. I need to
I am querying information from Active Directory . I have code that works, but
When querying a collection using linq it always returns a null Collection<JCTransLabour> oJCTransLabours =
Using SolrNet for querying & faceting. I have a combination of int, tdate and
I'm querying an SQLite database using NHibernate. Generally, I want to do case insensitive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.