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

  • Home
  • SEARCH
  • 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 8701879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:30:36+00:00 2026-06-13T02:30:36+00:00

my 1st day with stored procedures. when i call the procedure for the 2nd

  • 0

my 1st day with stored procedures.
when i call the procedure for the 2nd time i get an error?

it seems it has something to do with the way i fetch the result and i have to free the result?
I have tried different ways, but i can’t get it error-free:(

$t = 27;
$res = $mysqli->query("CALL ts_open_uitdagingen('".$t."')");
$aRes = $res->fetch_assoc();
echo '<br />'.$aRes['open_uitdagingen'].'<br />';
echo'<hr />';

$t = 80;
$res = $mysqli->query("CALL ts_open_uitdagingen('".$t."')");
echo "<br />CALL failed?: (" . $mysqli->errno . ") " . $mysqli->error;
$aRes = $res->fetch_assoc();
echo 'bBr />'.$aRes['open_uitdagingen'].'<br />';
echo'<hr />';

Displays:

1

CALL failed?: (2014) Commands out of sync; you can’t run this command now Fatal error: Call to a member function fetch_assoc() on a non-object in /home/xxxxxxxxxx.nl/public_html/content/speler_uitdagen.php on line 14

  • 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-13T02:30:37+00:00Added an answer on June 13, 2026 at 2:30 am

    I admit I never used mysqli in this way, but from this comment it seems that you need to use both $res->close() and $mysqli->next_result() before calling the SP again:

    $t = 27;
    $res = $mysqli->query("CALL ts_open_uitdagingen('".$t."')");
    $aRes = $res->fetch_assoc();
    echo '<br />'.$aRes['open_uitdagingen'].'<br />';
    echo'<hr />';
    $res->close();
    $mysqli->next_result();
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do i get today's date, 1st day of current month and last day
How to get the financial day of the year i.e., if i pass 2nd
1st Question: How do I get the title and subtitle of a selected annotation?
This is the 1st time I am using stackoverflow, I usually find answers to
taking value in 1st textbox and want to display it in 2nd.. 1st <input
I have 1st popup, and this 1st popup opens 2nd popup Code: <view-state id=paneMaintenance
Will the Hibernate caching(1st, 2nd, or Query) work when I use JdbcTemplate? I got
In Hadoop how to handle daily increasing data: For example: 1st day I may
I'm trying to find a way to combine the day/date/month into one string on
I'm wondering if there's an easy way (like using strtotime) whereby I can get

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.