Hi,

I'm having some problems with the Pear DB odbc extension, here is the
talk about them with an Easysoft developer, if it can help on resolving
the bug.

Thanks,

Tomas V.V.Cox

PS.- Please request me any extra info you need.

> "Martin J. Evans" wrote:
> > 
> > "Tomas V.V.Cox" wrote:
> > I'm trying this code (if you understand php code):
> >
> > $cols = odbc_fetch_into($result, $rownum, &$row);
> > if (!$cols) {
> >         if ($errno = odbc_error($this->connection)) {
> >                 var_dump($errno);
> >                 die();
> >         }
> >         return null;
> > }
> >
> > Sometimes works fine, but sometimes I get corrupted data in $errno (so
> > I'm not able to catch fetch row errors). Ie:
> > string(6) "ft_@("
> > string(4) "дн"
> > string(6) "thisX"
> > string(1) ""
> >
> 
> There are problems in PHP and not the back end.
> 
> The problems are:
> 
> [1] there is no way in the odbc_fetch_into() to tell the
>     difference between
>     [a] an empty result-set
>     [b] a non-empty result-set but the requested row did not
>        exist in the result-set
>     [c] and an error
>     odbc_fetch_into() returns false for all of these cases.
> [2] the odbc_fetch_into() function rarely calls odbc_sql_error
>     (an internal php_odbc.c fn calling the ODBC SQLError fn).
>     If SQLGetData to retrieve a column returns an error it will
>     call odbc_sql_error but that is about all.
> 
> The reason you are seeing garbage is simply that SQLError was
> never called and in any case, if you had an empty result-set or
> asked for a non-existant row there is no ODBC error -
> SQLExtendedFetch simply returns SQL_NO_DATA (which is not
> an error).
> 
> 
> Incidentally, I ran into problems on PHP 4.0.6 initially
> because I passed 1 for rownum into odbc_fetch_into. In this
> case I simply received the "document contained no data"
> message from my browser with no error in the PHP log and no
> error in my Apache log. I then found the comment in the PHP
> document saying you since 4.0.6 rownum HAS to be a variable.
> Surely this is a bug in PHP as well - my code was incorrect but
> PHP did not output anything in the error log at all - it was
> simply as if Apache had never passed the phtml to PHP.
> 
> Martin
> --
> Martin J. Evans
> Easysoft Ltd, UK
> Development

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to