cubrid_fetch_row

(PECL CUBRID >= 8.3.0)

cubrid_fetch_row — 현재 행의 값을 숫자 배열로 반환


설명

cubrid_fetch_row(resource $result, int $type = ?): array

이 함수는 0부터 시작하여 결과 집합의 현재 행 값이 포함된 숫자 배열을 반환하고 내부 데이터 포인터를 앞으로 이동합니다.


매개변수

result
cubrid_execute()를 호출한 result
type
Type은 CUBRID_LOB만 가능하며, 이 매개변수는 lob 객체를 조작해야 하는 경우에만 사용됩니다.

반환 값

프로세스가 성공한 경우 숫자 배열입니다.

행이 더 이상 없으면 false입니다. NULL, 프로세스가 성공하지 못한 경우.


Examples

예제 #1 cubrid_fetch_row() 예제

                  
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_execute($conn, "SELECT name,area,seats,address FROM stadium WHERE nation_code='GRE' AND seats > 10000");

printf("%-40s %-10s %-6s %-20s\n", "name", "area", "seats", "address");
while ($row = cubrid_fetch_row($req)) {
    printf("%-40s %-10s %-6s %-20s\n", $row[0], $row[1], $row[2], $row[3]);
}

// if you want to operate LOB object, you can use cubrid_fetch_row($req, CUBRID_LOB)

cubrid_close_request($req);

cubrid_disconnect($conn);
?>
                  
                

위의 예는 다음을 출력합니다.

name                                     area       seats  address
Panathinaiko Stadium                     86300.00   50000  Athens, Greece
Olympic Stadium                          54700.00   13000  Athens, Greece
Olympic Indoor Hall                      34100.00   18800  Athens, Greece
Olympic Hall                             52400.00   21000  Athens, Greece
Olympic Aquatic Centre                   42500.00   11500  Athens, Greece
Markopoulo Olympic Equestrian Centre     64000.00   15000  Markopoulo, Athens, Greece
Faliro Coastal Zone Olympic Complex      34650.00   12171  Faliro, Athens, Greece
Athens Olympic Stadium                   120400.00  71030  Maroussi, Athens, Greece
Ano Liossia                              34000.00   12000  Ano Liosia, Athens, Greece
                

기타