odbc_next_result
(PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8)
odbc_next_result — 여러 결과를 사용할 수 있는지 확인
설명
odbc_next_result(resource $statement
): bool
사용 가능한 결과 집합이 더 있는지 확인하고 odbc_fetch_array(), odbc_fetch_row(), odbc_result() 등을 통해 다음 결과 집합에 대한 액세스를 허용합니다.
매개변수
statement
- 결과 식별자입니다.
반환 값
결과 집합이 더 있으면 true
를 반환하고 그렇지 않으면 false
를 반환합니다.
Examples
예제 #1 odbc_next_result()
<?php
$r_Connection = odbc_connect($dsn, $username, $password);
$s_SQL = <<<END_SQL
SELECT 'A'
SELECT 'B'
SELECT 'C'
END_SQL;
$r_Results = odbc_exec($r_Connection, $s_SQL);
$a_Row1 = odbc_fetch_array($r_Results);
$a_Row2 = odbc_fetch_array($r_Results);
echo "Dump first result set";
var_dump($a_Row1, $a_Row2);
echo "Get second results set ";
var_dump(odbc_next_result($r_Results));
$a_Row1 = odbc_fetch_array($r_Results);
$a_Row2 = odbc_fetch_array($r_Results);
echo "Dump second result set ";
var_dump($a_Row1, $a_Row2);
echo "Get third results set ";
var_dump(odbc_next_result($r_Results));
$a_Row1 = odbc_fetch_array($r_Results);
$a_Row2 = odbc_fetch_array($r_Results);
echo "Dump third result set ";
var_dump($a_Row1, $a_Row2);
echo "Try for a fourth result set ";
var_dump(odbc_next_result($r_Results));
?>
위의 예는 다음을 출력합니다.
Dump first result set array(1) { ["A"]=> string(1) "A" } bool(false) Get second results set bool(true) Dump second result set array(1) { ["B"]=> string(1) "B" } bool(false) Get third results set bool(true) Dump third result set array(1) { ["C"]=> string(1) "C" } bool(false) Try for a fourth result set bool(false)