PHP + MySql + Stored Procedures, how do I get access an "out" value?
2011-09-06 21:33
831 查看
$mysqli = new mysqli( "HOST", "USR", "PWD", "DBNAME" ); $ivalue=1; $res = $mysqli->multi_query( "CALL myproc($ivalue,@x);SELECT @x" ); if( $res ) { $results = 0; do { if ($result = $mysqli->store_result()) { printf( "<b>Result #%u</b>:<br/>", ++$results ); while( $row = $result->fetch_row() ) { foreach( $row as $cell ) echo $cell, " "; } $result->close(); if( $mysqli->more_results() ) echo "<br/>"; } } while( $mysqli->next_result() ); } $mysqli->close();
此方法还是不行,最终是在存储过程中吧out参数select返回,相当于一个存储过程返回多个数据集。
相关文章推荐
- From an inner class, "this" points to the inner object. How do I get a "this" pointer to the enclosing object?
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now 问题的解决
- PHP+MySQL连续插入数据报错:Commands out of sync; you can't run this command now & 读取Excel数据并批量插入到数据中
- Please read "Security" section of the manual to find out how to run mysqld as root!错误解决
- MySQL-Communication link failure, message from server: "Can't get hostname for your address"
- How to get multiple select value both in javascript and php
- Attribute value request.getParameter("name") is quoted with " which must be escaped when used
- javascript cannot access textbox value marked as "false"
- Get "Server Down" when retrieve the channel list in sopcast, how to solve it?
- 解决mysql"Access denied for user'root'@'IP地址'"问题
- Call to undefined function getsqlvaluestring() with Dreamweaver PHP mysql
- MySQL安装后出现“Error 1045(28000) Access Denied for user....."解决办法
- how to make an "exe" installation File
- 使用"函数递归"实现基于php和MySQL的动态树型菜单
- MySQL无法登录问题-"ERROR 1045 (28000): Access denied for user 'root'@'localhost'"-之解决方法-密码重置
- new MySqlParameter("@val", 0).Value == null的异常
- <param name="allowScriptAccess" value="never"/>是什么意思
- 解决mysql"Access denied for user'root'@'IP地址'"问题
- Analyze提示:Value stored to "***"is never read
- Analyze提示:Value stored to "***"is never read