array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.odbc-next-result.php', 1 => 'odbc_next_result', ), 'up' => array ( 0 => 'ref.uodbc.php', 1 => 'Funciones ODBC', ), 'prev' => array ( 0 => 'function.odbc-longreadlen.php', 1 => 'odbc_longreadlen', ), 'next' => array ( 0 => 'function.odbc-num-fields.php', 1 => 'odbc_num_fields', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'es', 'path' => 'reference/uodbc/functions/odbc-next-result.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8)
odbc_next_result — Verifica si están disponibles múltiples resultados
Verifica si hay más conjuntos de resultados disponibles así como permitir el acceso al siguiente conjunto de resultados mediante odbc_fetch_array(), odbc_fetch_row(), odbc_result(), etc.
result_id
El identificador de resultado.
Ejemplo #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));
?>
El resultado del ejemplo sería:
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)