English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
odbc_field_scale() 함수는 필드의 소수점 자리수를 가져옵니다.
int odbc_field_scale ( resource $result_id , int $field_number )
부동소수점 숫자의 소수점 자리수를 얻기 위해 필드의 소수점 자리수를 가져옵니다.
필드의 소수점 자리수를 정수로 반환합니다. 오류가 발생하면 False를 반환합니다.
순번 | 매개변수와 설명 |
---|---|
1 | result_id 결과 식별자 |
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 scale %s\n", odbc_field_name($result, $col), odbc_field_scale($result, $col)); } ?>