PHP - Function field len
Syntax
int odbc_field_len ( resource $result_id , int $field_number )
Definition and Usage
It used to get a length of a field
Return Values
It returns length of a filed or false on error
Parameters
| Sr.No | Parameters & Description |
|---|---|
| 1 |
result_id It used to identifier the result |
| 2 | field_number It contains the information about filed number, field number starts from 1 |
Examples
Try out following example
<?php
$input_ID = odbc_connect("DSN","user_id","pass_id");
$sql = "SELECT * FROM Products";
$result = odbc_exec($input_ID, $sql);
odbc_fetch_row($result);
for ($col = 1; $col<=odbc_num_fields($result); $col++) {
printf("Column %s has length %s\n", odbc_field_name($result, $col), odbc_field_len($result, $col));
}
?>
php_function_reference.htm
Advertisements