cubrid_field_type 함수는 지정한 필드의 타입을 반환하며, 리턴되는 필드 타입은 CUBRID가 지원하는 데이터 타입 중 하나이다(예: "int", "float" 또는 "string").
string cubrid_field_type (resource $result , int $field_offset)
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$result = cubrid_execute($conn, "SELECT * FROM code");
$col_num = cubrid_num_cols($result);
printf("%-15s %-15s %s\n", "Field Table", "Field Name", "Field Type");
for($i = 0; $i < $col_num; $i++) {
printf("%-15s %-15s %s\n",
cubrid_field_table($result, $i), cubrid_field_name($result, $i), cubrid_field_type($result, $i));
}
cubrid_disconnect($conn);
?>
The above example will output:
Field Table Field Name Field Type
code s_name char(1)
code f_name varchar(6)
Output:
Your 'func' table has 4 fields and 1 record(s)
The table has the following fields:
string name 64 not_null primary_key binary
int ret 1 not_null
string dl 128 not_null
string type 9 not_null enum