note 6908 modified in odbc_result by ronabop
| From: | ronabop@php.net | Date: | Sat, 26 Aug 2000 06:34:01 +0000 |
| Subject: | note 6908 modified in odbc_result by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3381@lists.php.net to get a copy of this message | ||
Here's a limitation that isn't mentioned anywhere (that I could see) and gave me a rather
large headache for a couple of hours trying to figure out why my database wasn't initializing
correctly.
If you are trying to retrieve a large collection of fields from a database, be aware that
odbc_result may only return up to 33 result columns. Any more than that, and it generates a
"result out of range" warning in your script.
(I tried adjusting to have 32 fields, with the same bug.) It generates an error "Warning: Field
index is larger than the number of fields inyour-script.php on line 70" ANY time you try to
retrieve the last field of a sufficiently large record. What worked for me was just to write the
last column twice... that way, the query has 34 fields, but the last two are the same. You know
it'll crash if you ask for #34, but just use ODBC_result(current_query, 33) and you won't
have a problem. Good luck
-D
http://www.php.net/manual/function.odbc-result.php