《PHP學習:php mysql procedure實現獲取多個結果集的方法【基于thinkPHP】》要點:
本文介紹了PHP學習:php mysql procedure實現獲取多個結果集的方法【基于thinkPHP】,希望對您有用。如果有疑問,可以聯系我們。
相關主題:thinkphp教程
PHP實例本文實例講述了php mysql procedure實現獲取多個結果集的方法.分享給大家供大家參考,具體如下:
PHP實例
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]);
}
PHP實例更多關于PHP相關內容感興趣的讀者可查看本站專題:《php+mysqli數據庫程序設計技巧總結》、《php面向對象程序設計入門教程》、《PHP數組(Array)操作技巧大全》、《PHP基本語法入門教程》、《PHP運算與運算符用法總結》、《PHP網絡編程技巧總結》、《php字符串(string)用法總結》、《php+mysql數據庫操作入門教程》及《php常見數據庫操作技巧匯總》
PHP實例希望本文所述對大家PHP程序設計有所幫助.
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/2847.html