Re: Interbase DB module problems
| From: | Ludovico Magnocavallo | Date: | Mon, 21 Jan 2002 18:32:01 +0000 |
| Subject: | Re: Interbase DB module problems | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4023@lists.php.net to get a copy of this message | ||
Hi Lukas, thanks for taking the time to look into this. =)
> This may be a cause if the type casting used:
yes
> so what happends if you don't tell it to get an associative array?
I get an array of stdObject objects, with the proper values filled in
> Is there anything special about the result set that might cause the type
> casting to fail
No, tried with different queries against different tables
> generally I would not build applications using the associative array
> data unless I would really have to (but that is just a general advice)
Hmmm I need to pass an associative array from a query to a different class,
the other way would be to execute the query, retrieve field names, parse
through the result building an associative array myself, over and over again
on the site. I could write a small function for it, but since the
functionality is already in DB, I'd like to use it without introducing
hacks.
What's strange is, the same cast works ok in fetchRow (line 154). The other
thing I noticed, if I don't assign the casted hash from ibase_fetch_object
to the array ref passed as a parameter to fetchInto, everything works fine
(apart from the fact I get back an empty array). So I suspect there's
something wrong with the cast, and the assignment of the cast result to the
array reference, but I am at a loss as to what it could be. The DB API is
not the easiest to debug, too (though it's nice to use). =)
This things reminds me a lot of a bug that corrupted arrays with earlier
versions of php4.
Ludo