Get field name.
string i5_field_name (resource result/file, int field)
Parameters
| 
   result  | 
  
   Resource describing file or other record set 
  | 
 
| 
   field  | 
  
   Integer identifying the field position. 
  | 
 
Return
Field's name.
| 
   I5_ERR_PHP_HDLDFT  | 
  
   256  | 
  
   No default connection found.  | 
 
| 
   I5_ERR_PHP_OPTIONSTYPE  | 
  
   259  | 
  
   The type of " I5_OPTIONS_ALIAS" option must be x and not x  | 
 
| 
   I5_ERR_PHP_OPTIONSNUMBER  | 
  
   260  | 
  
   Option number -1 is unknown.  | 
 
| 
   I5_ERR_PHP_TYPEPARAM  | 
  
   262  | 
  
   Type of element x in parameter -1 must be y. Type z was provided.  | 
 
Example
                             $fields = i5_list_fields($file);
if (is_bool($fields))
{
print_r("i5_list_fields error : ".i5_errormsg().'<br/>');
}
else
{
$nb_fields = count($fields);
echo "s_customer file contains ".$nb_fields." fields.<br/>";
echo "Columns are as follow:<br/>";
for ($i=0; $i < $nb_fields; $i++)
{
$type = i5_field_type($file, $i);
$name = i5_field_name($file, $i);
$len = i5_field_len($file, $i);
if (is_bool($len))
{
print_r("i5_field_len error : ".i5_errormsg().'<br/>');
}
echo $type . " " . $name . " " . $len. '<br/>';
}
}
See also