#38784 [Opn->Bgs]: odbc_fetch_row call

From: Date: Wed, 13 Sep 2006 15:38:46 +0000
Subject: #38784 [Opn->Bgs]: odbc_fetch_row call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102107@lists.php.net to get a copy of this message
 ID:               38784
 Updated by:       kalowsky@php.net
 Reported By:      jkeagle at knology dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         ODBC related
 Operating System: Windows XP
 PHP Version:      4.4.4
 New Comment:

Why are you trusting odbc_num_rows?  

And fix your odbc_fetch_row call.  


Previous Comments:
------------------------------------------------------------------------

[2006-09-12 18:04:20] jkeagle at knology dot net

I tried the odbc_errormsg() call and got an empty string. I also tried
odbc_error() and got the same result. 
The problem is that a negative value is returned for each call to
odbc_fetch_row as if there are no rows to fetch. What is misleading is
that I can execute odbc_num_rows($res) and get 662, which is what I
expected to get. Also, a call to odbc_num_fields($res) was called and
returned the expected value of 2. What I don't understand is why I
can't "fetch a row" out the same result variable ($res). Everytime I
make a call to odbc_fetch_row($res), a negative value (0) is returned.

------------------------------------------------------------------------

[2006-09-12 16:45:59] tony2001@php.net

Use odbc_errormsg() to get the reson why it fails.

------------------------------------------------------------------------

[2006-09-12 14:59:34] keagle at westar dot com

By stating that the row number is "1-based", do you mean that rows are
indexed (1 .. last)? If so, this doesn't help answer my question. The
call returns false(0) regardless of the parameters passed into the call
(1 or 0). Why is it that I can't get a positive value returned out of
this call? It doesn't make sense. odbc_fatch_row($res) always returns a
negative value and odbc_result won't return anything I can use.

------------------------------------------------------------------------

[2006-09-12 13:40:06] jkeagle at knology dot net

Could you be more specific?

------------------------------------------------------------------------

[2006-09-12 09:33:00] tony2001@php.net

>odbc_fetch_row($res, 0)

The row number is 1-based.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/38784

-- 
Edit this bug report at http://bugs.php.net/?id=38784&edit=1


Thread (11 messages)

« previous php.bugs (#102107) next »