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 8572271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:58:18+00:00 2026-06-11T18:58:18+00:00

I have the following SQL function, and I have delare the $row in the

  • 0

I have the following SQL function, and I have delare the $row in the mysqli_stmt_bind_result.

//get the user number per month
public function chartwaitinguservsproduct(){
    $stmt = mysqli_prepare($this->connection, 
            "select 
                (Select COUNT(*)  from reusematching.waitinglist_product) as COUNTP,
                (Select COUNT(*)  from reusematching.waitinglist_user) as COUNTU;
                ");     
    $this->throwExceptionOnError();

    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();

    mysqli_stmt_fetch($stmt);
    mysqli_stmt_bind_result($stmt, $row->COUNTP, $row->COUNTU);


    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);

    return $rows;

}

but not matter how I change the Database, the $rows always NULL.
Why? because of the fetch statement??

  • 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-06-11T18:58:19+00:00Added an answer on June 11, 2026 at 6:58 pm

    Why are you using $row in one place (the bind) and returning $rows?

    Don’t you think that might be a bad idea, unless your PHP interpreter is far more advanced than the ones I’ve seen, and able to automatically associate singular and plural variable names 🙂

    And, from memory, I think you should probably bind the variables before trying to fetch from them. Again, if your PHP is advanced enough, I suppose it could do some form of temporal manipulation, but I wouldn’t bet money on it.


    Sorry, that’s the Australian humour coming through but if you examine the fetch page, it states quite clearly:

    Note that all columns must be bound by the application before calling mysqli_stmt_fetch().

    I’ll assume for now that the row/rows issue was just a typo in your question. If it wasn’t, then that will need fixing as well.

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

Sidebar

Related Questions

I have the following scalar function in MS SQL 2005: CREATE FUNCTION [dbo].[Distance] (
I have an MS SQL function that is called with the following syntax: SELECT
I have been writing a user-defined function in SQL Server: It looks like this
I have following SQL statementL: select DATE(bla), count(*) from tableA group by DATE(bla) UNION
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER
Hi I have following sql statement that gives me the the first_name and total
I have the following SQL Server query: SELECT area FROM places WHERE REPLACE(area,'-',' ')
I have the following SQL snippet within a select statement: CASE WHEN wot.id LIKE
I have the following SQL query: SELECT r.BEZEICHNUNG AS BEZEICHNUNG, r.ID AS ID, ra.BEZEICHNUNG
I have the following SQL Server stored procedure : BEGIN TRAN CREATE TABLE #TempTable

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.