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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:06:12+00:00 2026-05-27T15:06:12+00:00

<?php $mysqli=mysqli_connect(localhost,root,,politicalforum); $query=SELECT query_title FROM administrator; $query.=SELECT thread_id FROM threads; if($mysqli->multi_query($query)) { do {

  • 0
 <?php

$mysqli=mysqli_connect("localhost","root","","politicalforum");

 $query="SELECT query_title FROM administrator";
  $query.="SELECT thread_id FROM threads";

 if($mysqli->multi_query($query))
 { 
    do
    {

        if($result=$mysqli->store_result())
        {
            while($row=$result->fetch_row())
            {
                printf("%s\n",$row[0]);
            }
            $result->free();
        }

        if($mysqli->more_results())
        {
            print("-------------------------------");
        }
    }while($mysql->next_result());
 }


$mysqli->close();

?>

It doesnt work.. it doesnt go to the first if condition that identifies if it is a multiquery..
I have other question, ..why are multi_query() is useful..,

UPDATE:

Strict Standards: mysqli::next_result() [mysqli.next-result]: There is
no next result set. Please, call
mysqli_more_results()/mysqli::more_results() to check whether to call
this function/method in C:\xampp\htdocs\PoliticalForum2\test.php on
line 42

SOLVED:

 <?php

$mysqli=mysqli_connect("localhost","root","","politicalforum");

 $query="SELECT query_title FROM administrator;";
  $query.="SELECT thread_id FROM threads;";

 if($mysqli->multi_query($query))
 { 
    do
    {

        if($result=$mysqli->store_result())
        {
            while($row=$result->fetch_row())
            {
                printf("%s<br/>",$row[0]);
            }
            $result->free();
        }

        if($mysqli->more_results())
        {
            print("-------------------------------<br/>");
        }
        else
        {
            echo '<br/>';
        }
    }while($mysqli->more_results() && $mysqli->next_result());
 }


$mysqli->close();

?>

  • 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-27T15:06:12+00:00Added an answer on May 27, 2026 at 3:06 pm

    You need a semicolon at the end of the first query.

    $query="SELECT query_title FROM administrator;";
    $query.="SELECT thread_id FROM threads";
    

    mysqli::multi_query

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

Sidebar

Related Questions

<?php $objConnect = mysql_connect(localhost,,root) or die(mysql_error()); $objDB = mysql_select_db(mydb); $pic2 = SELECT * FROM
I followed the php.net's doc to get certain object's result from fetch_object , $mysqli
//require_once(../StoredProcedure/connect.php); $conn=mysql_connect(localhost,root,) or die(mysql_error); mysql_select_db(politicalforum,$conn); function updateThread($threadID, $content) { mysql_query(UPDATE threads SET content='$content' WHERE
Ok so i have a php script: <?php mysql_connect(localhost,root,root); mysql_select_db(FYP); $sql=mysql_query(select team_name, games_played, games_won,
I am trying the following code: <?php $link = mysql_connect('localhost', 'root', 'geheim'); if (!$link)
<?php $con = mysql_connect(localhost,root,); if (!$con) { die('Could not connect: ' . mysql_error()); }
For some reason when I changed my php code from mysql to mysqli everything
<?php class UBC_DB { private $db; public function connect() { $db = new mysqli('localhost',
I am using this code to insert some values in MySql table: <?php mysql_connect(localhost,root,root);
Consider the following code: <?php $conn = mysql_connect('localhost', 'username', 'password'); mysql_select_db('database', $conn); ?> This

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.