cubrid_field_type

설명

cubrid_field_type 함수는 지정한 필드의 타입을 반환하며, 리턴되는 필드 타입은 CUBRID가 지원하는 데이터 타입 중 하나이다(예: "int", "float" 또는 "string").

구문

string cubrid_field_type ( int $result , int $field_offset )

예제

<?php

$query = "SELECT * FROM func";

 

$result = cubrid_execute($link, $query);

if (!$result) {

echo 'Could not run query: ' .cubrid_error_msg();

exit;

}

 

$fields = cubrid_num_fields($result);

$rows   = cubrid_num_rows($result);

$table  = cubrid_field_table($result, 0);

echo "Your '" . $table . "' table has " . $fields . " fields and " . $rows . " record(s)\n";

echo "The table has the following fields:\n";

for ($i=0; $i < $fields; $i++) {

$type  = cubrid_field_type($result, $i);

$name  = cubrid_field_name($result, $i);

$len   = cubrid_field_len($result, $i);

$flags = cubrid_field_flags($result, $i);

echo $type . " " . $name . " " . $len . " " . $flags . "\n";

}

?>

 

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