RE: [PEAR-DEV] Interbase DB module problems

From: Date: Mon, 21 Jan 2002 18:08:39 +0000
Subject: RE: [PEAR-DEV] Interbase DB module problems
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4022@lists.php.net to get a copy of this message
This may be a cause if the type casting used: if ($fetchmode & DB_FETCHMODE_ASSOC) { >> $row = (array)ibase_fetch_object($result); } else { $row = ibase_fetch_row($result); } like you allready found out yourself it looks like an ugly hack but that is because ibase does not have something along the lines of mysql_fetch_array() so what happends if you don't tell it to get an associative array? Is there anything special about the result set that might cause the type casting to fail (note I am looking at this code for the first time ... just trying to help until the maintainers can help you) generally I would not build applications using the associative array data unless I would really have to (but that is just a general advice) Best regards, Lukas Smith smith@dybnet.de _______________________________ DybNet Internet Solutions GbR Alt Moabit 89 10559 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de info@dybnet.de _______________________________ > -----Original Message----- > From: Ludovico Magnocavallo [mailto:ludo@sumatrasolutions.com] > Sent: Monday, January 21, 2002 6:56 PM > To: pear-dev@lists.php.net > Cc: sterling@php.net > Subject: [PEAR-DEV] Interbase DB module problems > > I am having problems with the DB::ibase module, and I'm wondering if > anybody > else has seen the same thing. > > On a perfectly functional DB connection to interbase, if I try to get a > resultset from getAll() with fetchmode set to DB_FETCHMODE_ASSOC something > gets stuck in a loop, and all I get is the following error message, > repeated > forever: > > Warning: InterBase: request synchronization error in > /home/virtual/pear/DB/ibase.php on line 177 > > sample code: > > $q = "select first 5 url, name, tstamp from links where approved='Y' order > by tstamp desc"; > $vars = $db->getAll($q, null, DB_FETCHMODE_ASSOC); > > I tried a few things, but I can't find what's causing the bug. The only > thing I noticed is, if I remove the cast to array from ibase.php (lines > 176-178) > > if ($fetchmode & DB_FETCHMODE_ASSOC) { > $ar = ibase_fetch_object($result); > } > > instead of > > if ($fetchmode & DB_FETCHMODE_ASSOC) { > $ar = (array)ibase_fetch_object($result); > } > > everything works well, apart from the fact I get stdObjects where I need > hashes. > > I am running the latest pear CVS with php 4.1.1 compiled from sources on a > (more or less fully patched) RH 6.2 system. I have tried the same code > against Firebord 0.94 and 1.0 beta2 on the same machine, with the same > results. > > Is it a php interbase module bug? > > Thanks for any help in researching this bug > > Ludo > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net > For additional commands, e-mail: pear-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.pear.dev (#4022) next »