|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ovendrell at oip dot jazztel dot es
New email:
PHP Version: OS:


 [2006-06-23 10:10 UTC] ovendrell at oip dot jazztel dot es
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
2    NULL  comment
3    23    NULL
4    45    aaaaa
5    NULL  bbbb
6    12    ccccc

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-26 15:32 UTC]
Please try using this CVS snapshot:
For Windows (zip):

For Windows (installer):

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: Sat Jul 20 01:01:29 2024 UTC