類型一
$returnValue =
try {
mysql_query ( "set @Return" );
$spname =
mysql_query ( "call $spname(@Return
$result_return = mysql_query ( "select @Return" );
$row_return = mysql_fetch_row ( $result_return );
$returnValue = $row_return [
} catch ( Exception $e ) {
echo $e;
}
echo $returnValue; //輸出來自存儲過程中輸出的變量
類型二
$userId =
try{
mysql_query("set @Message");
mysql_query("set @Id");
mysql_query("call P__Test_Login(@Message
$result_mess = mysql_query("select @Message");
$result_uid = mysql_query("select @Id");
$row_mess = mysql_fetch_row($result_mess);
$row_uid = mysql_fetch_row($result_uid);
$Proc_Error = $row_mess[
$uId = $row_uid[
}
catch( Exception $e )
{
echo $e;
}
echo
echo
類型三
try {
$spname =
$query = mysql_query ( "call $spname()"
while ( $row = mysql_fetch_array ( $query ) ) {
echo $row [
}
} catch ( Exception $e ) {
echo $e;
}
類型四
//PHP
$rows = array ();
$db = new mysqli($server
if (mysqli_connect_errno()){
$this
}
$db
$db
if($db
do{
if($result = $db
while ($row = $result
array_push($rows
}
$result
}
}while($db
}
$db
print_r($rows);
//Procedure
……
select * from T
select * from T
……
From:http://tw.wingwit.com/Article/program/PHP/201311/21323.html