CUBRID Функции
PHP Manual

cubrid_fetch_assoc

(PECL CUBRID >= 8.3.0)

cubrid_fetch_assocReturns the associative array that corresponds to the fetched row

Описание

array cubrid_fetch_assoc ( resource $result )

This function returns the associative array, that corresponds to the fetched row and, then, moves the internal data pointer ahead, or it returns FALSE when the end is reached.

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

result

result comes from a call to cubrid_execute()

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

Associative array, when process is successful.

FALSE when the end is reached, or error.

Примеры

Пример #1 cubrid_fetch_assoc() example

<?php
    $link 
cubrid_connect("localhost"30000"demodb2""dba""");
    if (!
$link)
    {
        die(
'Could not connect.');
    }
    
$query 'SELECT name, address, salary FROM employees';
    
$result cubrid_execute($link$query);
    if (
$result
    {
        echo 
"seek to row 0 and fetching fields: ";
        
cubrid_data_seek($result0);
        
$row cubrid_fetch_assoc($result);
        echo 
$row["name"]."|"$row["address"]."|".$row["salary"]."<br>";

        echo 
"seek to row 2 and fetching fields: ";    
        
cubrid_data_seek($result2);
        
$row cubrid_fetch_assoc($result);
        echo 
$row["name"]."|"$row["address"]."|".$row["salary"]."<br>";

        
cubrid_close_request($result); 
    }
?>

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

Result:
seek to row 0 and fetching fields: Peter|1st Avenue, New York|1000.0000000000000000
seek to row 2 and fetching fields: Peter Norton|81254, CA|19834.0000000000000000

CUBRID Функции
PHP Manual