ID:               29324
 Updated by:       php-bugs@lists.php.net
 Reported By:      groenink at xs4all dot nl
-Status:           Feedback
+Status:           No Feedback
 Bug Type:         ODBC related
 Operating System: Windows XP
 PHP Version:      5.0.0
 New Comment:

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".


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

[2005-01-18 16:58:41] [EMAIL PROTECTED]

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



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

[2004-07-22 14:54:07] [EMAIL PROTECTED]

I know this is side-stepping the issue slightly, but would you mind
testing the PDO?

For a bit more info:
http://netevil.org/node.php?uuid=bf0a58d7-68ab-49d0-9a29-f5ec97c5dfde

You'll need:
http://snaps.php.net/win32/PECL_5_0/php_pdo.dll
http://snaps.php.net/win32/PECL_5_0/php_pdo_odbc.dll

Please reply directly to me ([EMAIL PROTECTED]) with feedback on PDO.


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

[2004-07-22 12:01:13] groenink at xs4all dot nl

Description:
------------
Accessing a NexusDB database from PHP using the ODBC driver results in
two problems, that cannot be reproduced using any other ODBC query
tools:

(1) The columns returned by odbc_fetch_array() are not indexed by their
column names, but by the values!!!

(2) Getting one row with odbc_fetch_array() is fine, but as soon as you
ask for the second one, the web server complains about an access
violation (both Apache and IIS).

Apparently the driver does something that the ODBC library in PHP
doesn't expect, but most other windows programs think is fine.

The problem exists in PHP 4.3.7 as well as PHP 5.0.0.


Reproduce code:
---------------
$db = odbc_connect("nexusdb", "", "");


// Don't use "select *", it will crash immediately.
// This is something the other ODBC tools seem to
// know and deal with as well.
//
$result = odbc_exec($db, "SELECT id, name FROM table");

$num_records_fetched  = 0;
$num_records_to_fetch = 2;

while ($row = odbc_fetch_array($result)) {
   $num_records_fetched++;
   echo "Row {$num_records_fetched}:";
   foreach ($row as $key => $value) {
      echo " {$key} => {$value}";
   }
   if ($num_records_fetched >= $num_records_to_fetch) {
      break;
   }
}


Expected result:
----------------
I'd expect to see:

row 1: id => 0001 name => foo
row 2: id => 0002 name => bar



Actual result:
--------------
I get an "access violation".


If I change "num_records_to_fetch" to 1, it no longer violates access,
but I see this instead:

row 1: 0001 => 0001 foo => foo




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


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

Reply via email to