php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38682 on fields with "(100*FIELDNAME) AS NAME ibase_fetch_object doesnt return values
Submitted: 2006-09-01 17:54 UTC Modified: 2007-09-14 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mojontp at gmx dot de Assigned:
Status: No Feedback Package: InterBase related
PHP Version: 5.1.6 OS: WINDOWS XP
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: mojontp at gmx dot de
New email:
PHP Version: OS:

 

 [2006-09-01 17:54 UTC] mojontp at gmx dot de
Description:
------------
queries like
"SELECT FIELD1, ...FIELD_i FROM
TABLENAME WHERE..." 
are ok.
but:

SELECT FIELD1, 
(SELECT SUM(XYZ) FROM TABLE2 WHERE FIELD=T1.NAME) AS VIRTNAME,
FIELD_i
FROM TABLE1 T1
WHERE...

leads to an error:
Fatal error: Cannot access empty property
in 
[PHP]
first:
$this->result=ibase_query($this->sqlQuery);

while($k<$numFields)
			                {
			                	$feldinfo=ibase_field_info($this->result,$k);
			                	$colNames[]=$feldinfo['name'];
			                	$k++;
			                }
then:

$datensatz = ibase_fetch_object($this->result);
$row[$colNames[$i]]=
$datensatz->$colNames[$i];<<----there

a direct access leads as well to an error:
$datensatz->VIRTNAME....

i hope its not too much text...




Reproduce code:
---------------
you can get the class in detail from
http://pilaf.ath.cx/pub/upload/upload/class_IBtable.txt


Actual result:
--------------
print_r(ibase_field_info($this->result,$k))--->
Array ( [0] => [name] => [1] => [alias] => [2] => [relation] => [3] => 8 [length] => 8 [4] => NUMERIC(18,2) [type] => NUMERIC(18,2) ) felder:1
.....


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-06 11:14 UTC] jani@php.net
Does this happen with PHP 5.2.4? If it does, update the version field accordingly.
 [2007-09-14 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: Fri Apr 19 16:01:27 2024 UTC