int odbc_field_len ( resource $result_id , int $field_number )
它用来获取一个字段的长度
Sr.No | 参数 & 描述 |
---|---|
1 |
result_id 它用来识别输出 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-field-len.html 来源:LearnFk无涯教程网 |
2 |
field_number 它包含有关字段编号的信息,字段编号从1开始 |
返回错误的字段长度或错误
<?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)); } ?>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)