php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27203 Querying database columns with name HIDE fails to get data
Submitted: 2004-02-10 05:06 UTC Modified: 2004-02-11 03:28 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: jakob at grimstveit dot no Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.3.4 OS: RedHat 9.0
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jakob at grimstveit dot no
New email:
PHP Version: OS:

 

 [2004-02-10 05:06 UTC] jakob at grimstveit dot no
Description:
------------
When running this query it gives 10 NULL values out of 12 rows, while in SQLplus&Tora it gives me the value actually found in the database for all rows. When renaming column to something random in the query, the data gets through to PHP, thus I guess it's related to the HIDE column being a keyword of some kind.

Reproduce code:
---------------
$query = "select hide from something"

Expected result:
----------------
A complete resultset

Actual result:
--------------
A resultset lacking values in the column named HIDE in 10 out of 12 rows.

See http://www.starshipping.com/~jakobbg/datafound.txt (correct resultset with sql row renamed to tyggegummi and http://www.starshipping.com/~jakobbg/datalacking.txt with original buggy resultset.

Data ($result) printed with print_r()

Hope this will be fixed soon.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-10 05:09 UTC] jakob at grimstveit dot no
About "Reproduce code": Actual SQL is shown in URL's described in "Actual result" area. Sorry about that.
 [2004-02-10 09:24 UTC] jakob at grimstveit dot no
Will do this as soon as possible. Creating a SuSE9 vmware installation and will compile apache and php with same options as on the rhl9-box used here. Can't deploy into same place since this is a prod-server :-)
 [2004-02-10 17:54 UTC] sniper@php.net
Nobody is asking you to _install_ the snapshot, you can just as easily run the script with CLI..do NOT touch this report before you're giving the asked feedback.

 [2004-02-10 21:13 UTC] cjbj at hotmail dot com
With respect to the filer, (i) this bug contains no reproducible PHP
code (ii) no table descriptions (iii) no sample data.

However from looking at the very little information available, the
data at http://www.starshipping.com/~jakobbg/datafound.txt shows both
a HIDE column and a TYGGEGUMMI column.  The HIDE column in
datalacking.txt has the same data as the datafound.txt HIDE column.

The datalacking.txt results are probably due to selecting two columns
called HIDE from two tables e.g. as t1.hide and t2.hide.  When doing
this and using associative arrays, only one column is returned by PHP.

There are a couple of recent user comments in
http://www.php.net/manual/en/function.ocifetchinto.php talking about
this.  The solution I added there recently is to use column aliases.

Given how PHP associative arrays do not include a table name
qualifier, I'd say this isn't a bug.
 [2004-02-11 03:28 UTC] jakob at grimstveit dot no
Closing.

As cjbj at hotmail dot com states: The HIDE column was found as an other column in the same query, thus being a problem (not a bug) with the way the assoc arrays handles multiple columns with same name.

Sorry if I didn' report this with enough data for you to study. 

Will this be implemented in a better way later?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 05:01:30 2024 UTC