cubrid_move_cursor
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
cubrid_move_cursor
Референца за `function.cubrid-move-cursor.php` со подобрена типографија и навигација.
cubrid_move_cursor
(PECL CUBRID >= 8.3.0)
cubrid_move_cursor — Move the cursor in the result
= NULL
$req_identifier, int $offset, int $origin Поместете го курсорот на lob објект): bool
На cubrid_move_cursor() function is used to move the current cursor location of req_identifier by the value set in the offset функцијата се користи за поместување на позицијата на курсорот на lob објект со вредноста поставена во origin argument. To set the
origin За да го поставите CUBRID_CURSOR_FIRST
for the first part of the result, CUBRID_CURSOR_CURRENT for the current location of the result, or CUBRID_CURSOR_LAST for the last part of the result. If origin argument is not explicitly designated, then the function uses CUBRID_CURSOR_CURRENT as its default value.
If the value of cursor movement range goes over the valid limit, then the cursor moves to the next location after the valid range for the cursor. For example, if you move 20 units in the result with the size of 10, then the cursor will move to 11th place and return CUBRID_NO_MORE_DATA.
Параметри
req_identifier- Идентификатор на барањето.
offset- Ако ја користите оваа функција за да ја поместите позицијата на курсорот на lob објектот, треба да поминете
origin- Location where you want to move the cursor from
CUBRID_CURSOR_FIRST,CUBRID_CURSOR_CURRENT,CUBRID_CURSOR_LAST.
Вратени вредности
Патеката до PHP скриптата што треба да се провери. true на успех или false при неуспех.
Примери
Пример #1 cubrid_move_cursor() example
<?php
$conn = cubrid_connect("127.0.0.1", 33000, "demodb", "dba");
$req = cubrid_execute($conn, "SELECT * FROM code");
cubrid_move_cursor($req, 1, CUBRID_CURSOR_LAST);
$result = cubrid_fetch_row($req);
var_dump($result);
cubrid_move_cursor($req, 1, CUBRID_CURSOR_FIRST);
$result = cubrid_fetch_row($req);
var_dump($result);
cubrid_move_cursor($req, 1, CUBRID_CURSOR_CURRENT);
$result = cubrid_fetch_row($req);
var_dump($result);
cubrid_close_request($req);
cubrid_disconnect($conn);
?>Пример #1 Пример што покажува затворачка ознака што го опфаќа последниот нов ред
array(2) {
[0]=>
string(1) "G"
[1]=>
string(4) "Gold"
}
array(2) {
[0]=>
string(1) "X"
[1]=>
string(5) "Mixed"
}
array(2) {
[0]=>
string(1) "M"
[1]=>
string(3) "Man"
}
Види Исто така
- cubrid_execute() , кога идентификаторот на барањето не е специфициран, и нема последно барање.