php存储过程调用举例
时间:2021-07-01 10:21:17
帮助过:17人阅读
//比如要调用的存储过程为gxtj(a,b) - $db=new mysqli("localhost","ssss","aaaaa","bbbb");
- mysqli_query($db,"SET NAMES utf8");
- $result=$db->query("call gxtj($year,$jd)"); // gxtj是mysql的存储过程名称 [color=gray][/color]
- while( $row = $result->fetch_array(MYSQLI_ASSOC)) //完成从返回结果集中取出一行
- {
- while ($key=key($row)){ //依次取得字段名
- $value=current($row); //依次取得字段值
- }
- }
|