[ Web 관련 ]/php
php mysql 쿼리 실행 오류 - Commands out of sync; you can't run this command now
BIZLAB
2021. 9. 15. 14:38
프로시저 실행후 쿼리를 실행하면 아래 오류 발생 가능성 있음
Commands out of sync; you can't run this command now
$conn = mysqli_connect($host, $user, $pass, $db);
$db_conn = mysqli_select_db($conn, $DBName);
....
$sql = " CALL USP_Appoint_Recommend() ";
$result = mysqli_query($conn, $sql);
(일반)
mysqli_next_result($conn);
(그누보드)
mysqli_next_result($g5['connect_db']);
참조
- mysqli_multi_query() - 데이터베이스에 대해 하나 이상의 쿼리를 수행합니다.
- mysqli_more_results() - 다중 쿼리에서 쿼리 결과가 더 있는지 확인
- mysqli_store_result() - 마지막 쿼리의 결과 집합을 전송합니다.
- mysqli_use_result() - 결과 세트 검색 시작