П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3409 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 5958 раз(а).

Учебник HTML.
Просмотров 3204 раз(а).

Руководство по PHP5.
Просмотров 5419 раз(а).

Хостинг через призму DNS.
Просмотров 4018 раз(а).

Подборка текстов стандартных документов.
Просмотров 55710 раз(а).

Учебник PHP - Самоучитель
Просмотров 2996 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 4573 раз(а).

Внешние атаки...
Просмотров 3732 раз(а).

Учебник PHP.
Просмотров 2767 раз(а).

SSI в примерах.
Просмотров 37384 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

db2_next_result

(PECL)

db2_next_result --  Requests the next result set from a stored procedure

Описание

resource db2_next_result ( resource stmt )

A stored procedure can return zero or more result sets. While you handle the first result set in exactly the same way you would handle the results returned by a simple SELECT statement, to fetch the second and subsequent result sets from a stored procedure you must call the db2_next_result() function and return the result to a uniquely named PHP variable.

Список параметров

stmt

A prepared statement returned from db2_exec() or db2_execute().

Возвращаемые значения

Returns a new statement resource containing the next result set if the stored procedure returned another result set. Returns FALSE if the stored procedure did not return another result set.

Примеры

Пример 1. Calling a stored procedure that returns multiple result sets

In the following example, we call a stored procedure that returns three result sets. The first result set is fetched directly from the same statement resource on which we invoked the CALL statement, while the second and third result sets are fetched from statement resources returned from our calls to the db2_next_result() function.

<?php
$conn
= db2_connect($database, $user, $password);

if (
$conn) {
  
$stmt = db2_exec($conn, 'CALL multiResults()');

  print
"Fetching first result set\n";
  while (
$row = db2_fetch_array($stmt)) {
    
var_dump($row);
  }

  print
"\nFetching second result set\n";
  
$res = db2_next_result($stmt);
  if (
$res) {
    while (
$row = db2_fetch_array($res)) {
      
var_dump($row);
    }
  }

  print
"\nFetching third result set\n";
  
$res2 = db2_next_result($stmt);
  if (
$res2) {
    while (
$row = db2_fetch_array($res2)) {
      
var_dump($row);
    }
  }

  
db2_close($conn);
}
?>

Результат выполнения данного примера:

Fetching first result set
array(2) {
  [0]=>
  string(16) "Bubbles "
  [1]=>
  int(3)
}
array(2) {
  [0]=>
  string(16) "Gizmo   "
  [1]=>
  int(4)
}

Fetching second result set
array(4) {
  [0]=>
  string(16) "Sweater "
  [1]=>
  int(6)
  [2]=>
  string(5) "llama"
  [3]=>
  string(6) "150.00"
}
array(4) {
  [0]=>
  string(16) "Smarty  "
  [1]=>
  int(2)
  [2]=>
  string(5) "horse"
  [3]=>
  string(6) "350.00"
}

Fetching third result set
array(1) {
  [0]=>
  string(16) "Bubbles "
}
array(1) {
  [0]=>
  string(16) "Gizmo   "
}



Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru