Php mysql procedure method for obtaining multiple result sets [based on thinkPHP], procedurethinkphp
This example describes how to obtain multiple result sets using php mysql procedure. We will share this with you for your reference. The details are as follows:
Protected function getRs ($ id) {$ db = new mysqli (C ("DB_HOST"), C ("DB_USER"), C ("DB_PWD "), C ("DB_NAME"), C ("DB_PORT"); if (mysqli_connect_errno () throw_exception (mysqli_connect_error (); $ SQL = "call 'room _ Match '. 'wskocmatchloadresultheader '($ id); "; $ results = array (); if ($ db-> multi_query ($ SQL) {do {$ records = array (); if ($ result = $ db-> use_result () {while ($ row = $ result-> fetch_array (MYSQLI_ASSOC) {$ records [] = $ row ;} $ result-> close () ;}$ results [] = $ records;} while ($ db-> next_result () ;}$ db-> close (); $ this-> assign ("list1", $ results [1]); $ this-> assign ("list2", $ results [2]); $ this-> assign ("list3", $ results [3]);}