Versions available for this page: CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 |
The cubrid_field_type() function is similar to the cubrid_field_name() function. The arguments are identical, but the field type is returned instead. The returned field type will be one of "int", "real", "string", etc.
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)