この単純なコードは2つのMySQLプロシージャを呼び出しますが、値を返す最初のプロシージャの後、2番目のクエリでエラーを返します。
注: 1番目または2番目を単独で実行すると、それぞれが正しく返されます。したがって、クエリは一緒にではなく機能します。
完全なエラーは次のとおりです。
Invalid query: Commands out of sync; you can't run this command now
どんなアイデアでもお願いします。
<?php
require_once ('connection.php');
//First Query and Output
$result = mysql_query("CALL C01_Client_Summary_ByAccount(1, '2012-02-27', '2013-03-29');");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
while($row=mysql_fetch_array($result))
{
echo $row['CommisionPercentage'];
}
mysql_free_result($result);
//END First Query and Output
//Second Query and Output
$new2 = mysql_query("CALL C01_Client_Summary_ByBetType(1, '2012-02-27', '2013-03-29');");
if (!$new2) {
die('Invalid query: ' . mysql_error());
}
while($row=mysql_fetch_array($new2))
{
echo $row['Turnover'];
}
//END Second Query and Output
?>