This article describes the PHP MySQL procedure implementation to get multiple result sets of methods. Share to everyone for your reference, specific 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]);
}
More interested in PHP related content readers can view the site topics: "PHP+MYSQLI Database Programming Skills Summary", "PHP object-oriented Program Design Introductory Course", "PHP Array" operation Skills Encyclopedia, "PHP Basic Grammar Introductory Course", " Summary of PHP operations and operator usage, "Summary of PHP Network programming skills", "PHP string (String) Usage Summary", "Php+mysql Database Operation Introduction" and "PHP common database Operation Skills Summary"
I hope this article will help you with the PHP program design.