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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:02:25+00:00 2026-05-24T07:02:25+00:00

I have a self calling php form that is supposed to update the database,

  • 0

I have a self calling php form that is supposed to update the database, then display the changes. This is the general idea of what the code looks like:

IF($condition)
    mysqli_multi_query($dbc,$multiple_update_query_str);
$result = mysqli_query($dbc,$select_query);
while($row = mysqli_fetch_array($result))
    echo    $row[0] . " " . $row[1] . " " . $row[2] . "<br>";

The first time, when the $condition is false, the select query works perfectly. Then when the $condition is true, the update occurs on the database, but the select query fails.

My first thought was that php server was getting ahead of the mySQL server, so I used sleep(5) before exiting the if statement, but the select still failed.

I even wrote a very basic php file that was almost exactly this code. It had the same problem. Is there something I am missing?

  • 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-24T07:02:26+00:00Added an answer on May 24, 2026 at 7:02 am

    before you can use mysqli_query you must retrieve all the results of the multy_query to unlock the link connection

    try:

    if($condition){
        mysqli_multi_query($dbc,$multiple_update_query_str);
        while(mysqli_next_result($dbc)){;}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP form that needs some very simple validation on submit. I'd
I have a self calling function. var controller = new (function () { this.func
I have a UITableView populated with a location-based datasource. I'm calling [self updateView]; to
I have a self referencing table named categories that has a parentcategoryid column that
I have a self referencing table in Oracle 9i, and a view that gets
I've got a function called updateTheValue() that I have called using [self updateTheValue] for
I have this big problem that i dont know how to fix. I have
I have a database class that I made that uses PDO to connect to
I have tried calling self.setStyleSheet(background: transparent; border: transparent;) on a QGraphicsView, but it still
I have a NSViewController which I manually put into the responder-chain by calling self.nextResponder

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.