• PHP Video Tutorials

PHP - Function Field Scale



Syntax

int odbc_field_scale ( resource $result_id , int $field_number )

Definition and Usage

It used to get scale of filed

Return Values

It returns scale of 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 field number and it 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 scale %s\n", odbc_field_name($result, $col), odbc_field_scale($result, $col));
   }
?>
php_function_reference.htm
Advertisements