2008-09-07 79 views

回答

15

它看起來像它的回答在這個崗位:

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

隨着mysqli的PHP API:

假設存儲過程myproc的(IN 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();