search

Home  >  Q&A  >  body text

Unbuffered queries in MySQLi?

Are MySQLi queries unbuffered? If not, is there a way to perform unbuffered queries, just like non-MySQLi mysql_unbuffered_query()?

P粉769413355P粉769413355395 days ago594

reply all(2)I'll reply

  • P粉216807924

    P粉2168079242023-10-25 10:29:41

    MindStalker is right, but perhaps the easiest way is the one shown in the PHP manual
    http: //php.net/manual/en/mysqlinfo.concepts.buffering.php

    Passing the MYSQLI_USE_RESULT constant as the resultmode parameter, you can set mysqli_query to be used as mysql_unbuffered_query

    query("SELECT Name FROM City", MYSQLI_USE_RESULT);
    
    if ($uresult) {
       while ($row = $uresult->fetch_assoc()) {
           echo $row['Name'] . PHP_EOL;
       }
    }
    $uresult->close();
    ?>

    reply
    0
  • P粉377412096

    P粉3774120962023-10-25 09:23:01

    mysqli_real_query() back mysqli_use_result()

    reply
    0
  • Cancelreply