odbc_field_num

int odbc_field_num(resource result, string field) 

Displays field number.

Returns:

Number of the field specified by the field name; FALSE on error

Description:

Returns the number of the field specified by a field name.

Version:

Existing since version 3.0.6

Example:

Find the field number
$db = odbc_connect("DSN","user","pass"); 
$sql = "SELECT * FROM Products"; 
$result = odbc_exec($db, $sql); 
odbc_fetch_row($result); 
printf("ProductName is column number %s\n", 
    odbc_field_num($result, "ProductName")); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.