cubrid_field_seek
(PECL CUBRID >= 8.3.0)
cubrid_field_seek — 결과 집합 커서를 지정된 필드 오프셋으로 이동
설명
cubrid_field_seek(resource $result
, int $field_offset
= 0): bool
이 함수는 결과 집합 커서를 지정된 필드 오프셋으로 이동합니다. 이 오프셋은 필드 오프셋을 포함하지 않는 경우 cubrid_fetch_field()에서 사용한다. 성공하면 TRUE를, 실패하면 FALSE를 반환합니다.
매개변수
result
- cubrid_execute()를 호출한
result
field_offset
- 숫자 필드 오프셋입니다.
field_offset
은 0부터 시작합니다.field_offset
이 없으면E_WARNING
수준의 오류도 발생합니다.
반환 값
성공 시 true
.
실패시 false
.
Examples
예제 #1 cubrid_field_seek() 예제
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_execute($conn, "SELECT event_code,athlete_code,nation_code,game_date FROM game WHERE host_year=1988 and event_code=20001;");
var_dump(cubrid_fetch_row($req));
cubrid_field_seek($req, 1);
$field = cubrid_fetch_field($req);
printf("\n--- Field Properties ---\n");
printf("%-30s %s\n", "name:", $field->name);
printf("%-30s %s\n", "table:", $field->table);
printf("%-30s \"%s\"\n", "default value:", $field->def);
printf("%-30s %d\n", "max length:", $field->max_length);
printf("%-30s %d\n", "not null:", $field->not_null);
printf("%-30s %d\n", "unique key:", $field->unique_key);
printf("%-30s %d\n", "multiple key:", $field->multiple_key);
printf("%-30s %d\n", "numeric:", $field->numeric);
printf("%-30s %s\n", "type:", $field->type);
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
위의 예는 다음을 출력합니다.
array(4) { [0]=> string(5) "20001" [1]=> string(5) "16132" [2]=> string(3) "KOR" [3]=> string(9) "1988-09-30" } --- Field Properties --- name: athlete_code table: game default value: "" max length: 0 not null: 1 unique key: 1 multiple key: 0 numeric: 1 type: integer