이 코드는 내 localhost (Xampp, PHP 5.4)에서 제대로 작동하지만이 코드를 서버 (Wamp, PHP 5.5)에 배포하면 $mysqli->multiquery()
에 대해이 오류가 발생합니다. 처음에는 여러 결과 집합을 반환 wc_new_tyre_article
를 호출하고 위의 코드 당으로엄격한 표준 - mysqli :: next_result() - 다음 결과가 없습니다.
if($mysqli->multi_query("CALL `wc_new_tyre_article` ('$season','$dimB','$dimQ','$dimD','$com_id','$adr_id')")){
do{
if($result = $mysqli->store_result()){
while($row = $result->fetch_object()){
if(isset($row->empty))
break 1;
$articleId = $row->ART_ID;
$ggrId = $row->GGR_ID;
$articles[] = $row;
}
$result->close();
}
}while($mysqli->next_result() && $mysqli->more_results());
for($index = 0;$index<count($articles);$index++){
$articleId = $articles[$index]->ART_ID;
$ggrId = $articles[$index]->GGR_ID;
if(!empty($articleId) && !empty($ggrId)){
if($stk_results = $mysqli->query("CALL `wc_get_stock` ('$articleId','$ggrId','$com_id')")){
while($rows = mysqli_fetch_object($stk_results)){
$articles[$index]->STOCK = $rows;
while($mysqli->next_result()){
if($l_result = $mysqli->store_result())
$l_result->free();
}
}
}
}
}
return $articles;
:
여기 내 코드입니다. 이 결과를 사용하여 다른 SP wc_get_stock
을 호출하여 다른 결과를 가져옵니다.
여기에 나와있는 모든 솔루션을 시도했지만 아무도 작동하지 않습니다.
나는 error_reporting(E_ALL^E_STRICT)
을 시도했다.
이 읽으십시오 : http://php.net/manual/en/mysqli.multi-query.php#102837 –
@Marco 내 코드가 맞다 고 생각합니다. multi_query 결과가 do_while에 플러시 될 것입니다 - refrence 당. mysqli-> query가 실행될 것이다. 그래서 그것은 일해야합니다. 그리고 난 내 localhost에서 절대적으로 핵심 결과를 얻을 수 있습니다. 생방송에서 문제가 발생합니다. 당신이 생각하는 것? – rut2
내가 링크 한 코멘트는 && $ mysqli-> more_results()는 필요하지 않다고 말했지만 오류는 그렇게 말합니다. 어쩌면 둘 다 퍼팅하는 것이 한 번에 두 줄을 앞으로 나아가는 것과 같은 문제를 일으킬 것입니까? –