note 43357 added to function.odbc-field-name
| From: | mike at jcsvc dot com | Date: | Fri, 18 Jun 2004 14:59:26 +0000 |
| Subject: | note 43357 added to function.odbc-field-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71292@lists.php.net to get a copy of this message | ||
Here is a function that will allow you to call data by the fieldname:
function odbc_named_results($results,$fieldname){
$field_array = array();
$fCount = odbc_num_fields($results);
for($i = 1 ; $i < $fCount ; $i++){
$field_array[odbc_field_name ($results, $i)] = $i;
}
return odbc_result($results,$field_array[$fieldname]);
}
Syntax is:
odbc_named_results($results,"fieldname");
----
Manual Page -- http://www.php.net/manual/en/function.odbc-field-name.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43357
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43357&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43357&report=yes
Search -- http://master.php.net/manage/user-notes.php