PHP: mysqli clearing stored results -


i using function clear stored results after calling procedure etc.

function clearstoredresults($mysqli_link){ #------------------------------------------     while($mysqli_link->next_result()){       if($l_result = $mysqli_link->store_result()){               $l_result->free();       }     } } 

but keep getting following message/error

mysqli::next_result(): there no next result set. please, call mysqli_more_results()/mysqli::more_results() check whether call function/method in

if change next_result() more_results() page keeps loading while , time out error:

maximum execution time of 30 seconds exceeded

any ideas on how fix this?

you need use both methods:

function clearstoredresults($mysqli_link) { #------------------------------------------     while($mysqli_link->more_results()) {          $mysqli_link->next_result();          if($l_result = $mysqli_link->store_result()) {               $l_result->free();          }      } } 

use more_results control loop, , next_result move cursor.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -