Voting

: three minus two?
(Example: nine)

The Note You're Voting On

luka8088 at owave dot net
14 years ago
if you don't iterate through all results you get "server has gone away" error message ...

to resolve this, in php 5.2 it is enough to use

<?php
// ok for php 5.2
while ($mysqli->next_result());
?>

to drop unwanted results, but in php 5.3 using only this throws

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

so it should be replaced with

<?php
// ok for php 5.3
while ($mysqli->more_results() && $mysqli->next_result());
?>

I also tried but failed:

<?php

// can create infinite look in some cases
while ($mysqli->more_results())
$mysqli->next_result();

// also throws error in some cases
if ($mysqli->more_results())
while (
$mysqli->next_result());

?>

<< Back to user notes page

To Top