Get the numbers of fields of resource.
int i5_num_fields (resource result/query)
Parameters
result |
Resource describing file or other record set.
|
Return
Number of fields. False is returned if error.
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. |
Example
$file = i5_open("EASYCOMXMP/s_customer");
if (is_bool($file))
{
print_r("i5_open error : ".i5_errormsg().'<br/>');
}
else
{
$numFields=i5_num_fields($file);
if (is_bool($numFields))
{
print_r("i5_num_fields error : ".i5_errormsg().'<br/>');
}
else
{
echo "s_customer file has ". $numFields . " fields<br/>";
}
}
See also