cubrid_num_fields
(PECL CUBRID >= 8.3.0)
cubrid_num_fields — Return the number of columns in the result set
Description
int cubrid_num_fields
( resource
$result
)This function returns the number of columns in the result set, on success, or it returns FALSE on failure.
Return Values
Number of columns, on success.
-1 if SQL sentence is not SELECT.
FALSE
when process is unsuccessful.
Examples
Example #1 cubrid_num_fields() example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_execute($conn, "SELECT * FROM code");
$row_num = cubrid_num_rows($req);
$col_num = cubrid_num_fields($req);
printf("Row Num: %d\nColumn Num: %d\n", $row_num, $col_num);
cubrid_disconnect($conn);
?>
The above example will output:
Row Num: 6 Column Num: 2
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Расширения для работы с базами данных отдельных производителей
- CUBRID
- cubrid_affected_rows
- cubrid_client_encoding
- cubrid_close
- cubrid_data_seek
- cubrid_db_name
- cubrid_errno
- cubrid_error
- cubrid_fetch_array
- cubrid_fetch_assoc
- cubrid_fetch_field
- cubrid_fetch_lengths
- cubrid_fetch_object
- cubrid_fetch_row
- cubrid_field_flags
- cubrid_field_len
- cubrid_field_name
- cubrid_field_seek
- cubrid_field_table
- cubrid_field_type
- cubrid_list_dbs
- cubrid_num_fields
- cubrid_ping
- cubrid_query
- cubrid_real_escape_string
- cubrid_result
- cubrid_unbuffered_query
Коментарии
404 Not Found