문제

문서는 심각한 부족에서는 아무와 저장된 절차에 PHP mysql.나는 현재는 저장 프로시저 전화를 통해 PHP,를 얻을 수 있는 방법을 out 매개 변수 값?

도움이 되었습니까?

해결책

그것은 그의 대답에서 이 게시물:

http://forums.mysql.com/read.php?52,198596,198717#msg-198717

와 mysqli PHP API:

가정 sproc myproc(i int,웃 j int):

$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, "&nbsp;";
      }
      $result->close();
      if( $mysqli->more_results() ) echo "<br/>";
    }
  } while( $mysqli->next_result() );
}
$mysqli->close();

다른 팁

여기서의 예를 사용하여 이 작업을 수행하는 방법 mysql,mysqli 및 pdo:

http://www.joeyrivera.com/2009/using-mysql-stored-procedures-with-php-mysqlmysqlipdo/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top