Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 | 



cubrid_num_cols/cubrid_num_fields

Description

The cubrid_num_cols() and cubrid_num_fields() functions are used interchangeably and they gets the number of columns in the query result. This is available only with the SELECT statement.

Syntax

int cubrid_num_cols (resource $req_identifier)

int cubrid_num_fields (resource $req_identifier)

  • req_identifier : Request identifier
Return Value
  • Success : The number of columns
  • Error : -1
Example

$req = cubrid_execute ($con, "select * from member");

if ($req) {

    $rows_count = cubrid_num_rows ($req);

    $cols_count = cubrid_num_cols ($req);

    echo "result set rows count : $rows ";

    echo "result set columns count : $cols ";

    cubrid_close_request ($req);

}

See Also