note 14450 added to function.odbc-field-name.php
| From: | curt at digmo dot com | Date: | Tue, 31 Jul 2001 22:58:37 +0000 |
| Subject: | note 14450 added to function.odbc-field-name.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16136@lists.php.net to get a copy of this message | ||
I turned Jason's code into a function to roughly mimic the mysql_fetch_array function. I'm
not a programmer and I've been messing with PHP less than a week, so I imagine there's a
more efficient method that what I've come up with.
function odbc_fetch_array($rownum, $res)
{
$i = 0;
$fCount = odbc_num_fields($res);
odbc_fetch_row($res, $rownum);
while ($i < $fCount)
{
$i++;
$fName = odbc_field_name($res, $i);
$myrow[$fName] = odbc_result($res, $i);
}
$i=0;
return $myrow;
}
http://www.php.net/manual/en/function.odbc-field-name.php