Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

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



cubrid_field_table

Description

The cubrid_field_table function returns the name of the table that the specified field is in.

Syntax

string cubrid_field_table (resource $result , int $field_offset)

  • result : Result that comes from a call to cubrid_execute()
  • field_offset : The numerical field offset. The field_offset starts at 0. If field_offset does not exist, an error occurs.
Return Value
  • Success : Name of the table of the specified field
  •   Invalid field_offset value : FALSE
  • SQL sentence is not SELECT : -1
Example

<?php

$conn = cubrid_connect("localhost", 33000, "demodb");

$result = cubrid_execute($conn, "SELECT * FROM code");

 

$col_num = cubrid_num_cols($result);

 

printf("%-15s %-15s %s ", "Field Table", "Field Name", "Field Type");

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

    printf("%-15s %-15s %s ",

        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)