code_junkie

PHP + MySql + Stored Procedures, how do I get access an “out” value?

Nov 10th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $mysqli = new mysqli( "HOST", "USR", "PWD", "DBNAME" );
  2. $ivalue=1;
  3. $res = $mysqli->multi_query( "CALL myproc($ivalue,@x);SELECT @x" );
  4. if( $res ) {
  5. $results = 0;
  6. do {
  7. if ($result = $mysqli->store_result()) {
  8. printf( "<b>Result #%u</b>:<br/>", ++$results );
  9. while( $row = $result->fetch_row() ) {
  10. foreach( $row as $cell ) echo $cell, "&nbsp;";
  11. }
  12. $result->close();
  13. if( $mysqli->more_results() ) echo "<br/>";
  14. }
  15. } while( $mysqli->next_result() );
  16. }
  17. $mysqli->close();
Add Comment
Please, Sign In to add comment