php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37900 NULL values on a first record
Submitted: 2006-06-23 10:10 UTC Modified: 2007-08-03 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ovendrell at oip dot jazztel dot es Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 5.1.4 OS: Linux
Private report: No CVE-ID: None
 [2006-06-23 10:10 UTC] ovendrell at oip dot jazztel dot es
Description:
------------
I work with this environment:
* OS: Linux
* Web server: Apache 2.0
* DB server: Microsoft SQL server (7.0 or 2000)
* PHP 5.1.2

I execute a query with odbc_query() function. when the first record result has a NULL value in a field, the next record that doesn't has a NULL value in the same field doesn't return the correct value. It returns unrecognizable chars. 

Reproduce code:
---------------
$res = odbc_exec ($bd, "SELECT Id, Num, Obs FROM publicacions");
odbc_result_all ($res);

-----------

$res = odbc_exec ($bd, "SELECT Id, Num FROM publicacions");
while (odbc_fetch_row ($res))
     echo odbc_result ($res, "Id")." ".odbc_result ($res, "Num")." ".odbc_result ($res, "Obs")."<br>";



Expected result:
----------------
Id   Num   Obs
--------------
1    NULL  NULL
2    NULL  comment
3    23    NULL
4    45    aaaaa
5    NULL  bbbb
6    12    ccccc


Actual result:
--------------
Id   Num   Obs
--------------
1    NULL  NULL
2    NULL  ??H@??H@
3    ??H@  NULL
4    45    aaaaa
5    NULL  bbbb
6    12    ccccc


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-26 15:32 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

And try using the PDO ODBC instead. It has been reported to work much better..
 [2007-08-03 01:00 UTC] php-bugs at lists dot php dot net
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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 12:01:28 2024 UTC