php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33238 Bug select odbc_fetch_row
Submitted: 2005-06-03 22:05 UTC Modified: 2005-06-11 19:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: olivier at pipas dot org Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 5.*, 4.* (2005-06-04) OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 - 31 = ?
Subscribe to this entry?

 
 [2005-06-03 22:05 UTC] olivier at pipas dot org
Description:
------------
I do a select in a db access (odbc), it return good number of rows but cannot show it

Reproduce code:
---------------
if(!$conn=odbc_connect("mydbodbc","user","pass"))
	exit("Error connect DB");
$sql="SELECT numcountry, namecountry FROM countries;";
if(!$res=odbc_exec($conn,$sql))
	exit("Error syntax : $sql");
$i=0;
while($restab=odbc_fetch_row($res))
{
	echo $restab;
	echo "$restab[0] $restab[1]<br>\n";
	$i++;
}
echo $i;

Expected result:
----------------
Array1 Belgium<br>
Array2 France<br>
Array3 Spain<br>
3

Actual result:
--------------
1 <br>
1 <br>
1 <br>
3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-03 22:09 UTC] olivier at pipas dot org
I use apache 2 and php as an Apache module
 [2005-06-03 22:15 UTC] olivier at pipas dot org
I have tested with odbc_fetch_object, and it's working ! 

So : it's a bug in function odbc_fetch_row
 [2005-06-03 22:59 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip


 [2005-06-03 23:26 UTC] olivier at pipas dot org
I have tried this version (5.0.5-dev) but the bug is always present.

This bug is also present in 5.0.0 and 4.3.11
 [2005-06-04 01:07 UTC] sniper@php.net
And how can we reproduce this? (we need the db..)

 [2005-06-04 09:59 UTC] olivier at pipas dot org
Sorry, sorry

It's not a bug :

mysql_fetch_row return an array
pgsql_fetch_row return an array
mssql_fetch_row return an array
but...
odbc_fetch_row return an boolean ! (why ???)

I must use odbc_result after...
 [2005-06-11 19:51 UTC] sniper@php.net
Impossible to reproduce without a test case. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC