
mysqli_stmt::next_result 함수를 사용하여 여러 쿼리를 실행한 후, mysqli_stmt::store_result 함수를 호출해야 합니다.
mysqli_stmt::next_result 함수는 이전 쿼리의 결과를 무시하고 다음 쿼리의 결과를 가져올 때 사용됩니다. 그러나 mysqli_stmt::next_result 함수를 호출한 후, mysqli_stmt::store_result 함수를 호출하지 않으면, 다음 쿼리의 결과를 가져올 수 없습니다.
예를 들어, 다음 쿼리를 실행하는 경우:
#hostingforum.kr
php
$stmt = $mysqli->prepare("SELECT * FROM table1");
$stmt->execute();
$stmt->store_result();
$stmt = $mysqli->prepare("SELECT * FROM table2");
$stmt->execute();
$stmt->store_result();
mysqli_stmt::next_result 함수를 사용하여 여러 쿼리를 실행하는 경우:
#hostingforum.kr
php
$stmt = $mysqli->prepare("SELECT * FROM table1");
$stmt->execute();
$stmt->store_result();
$stmt = $mysqli->prepare("SELECT * FROM table2");
$stmt->execute();
mysqli_stmt::next_result($stmt);
$stmt->store_result();
mysqli_stmt::next_result 함수를 호출한 후, mysqli_stmt::store_result 함수를 호출하지 않으면, 다음 쿼리의 결과를 가져올 수 없습니다. 따라서 mysqli_stmt::next_result 함수를 호출한 후, mysqli_stmt::store_result 함수를 호출해야 합니다.
2025-08-13 20:07