#38682 [Opn->Fbk]: on fields with "(100*FIELDNAME) AS NAME ibase_fetch_object doesnt return values
| From: | jani@php.net | Date: | Thu, 06 Sep 2007 11:14:17 +0000 |
| Subject: | #38682 [Opn->Fbk]: on fields with "(100*FIELDNAME) AS NAME ibase_fetch_object doesnt return values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117224@lists.php.net to get a copy of this message | ||
ID: 38682
Updated by: jani@php.net
Reported By: mojontp at gmx dot de
-Status: Open
+Status: Feedback
Bug Type: InterBase related
Operating System: WINDOWS XP
PHP Version: 5.1.6
Previous Comments:
------------------------------------------------------------------------
[2007-09-06 11:14:10] jani@php.net
Does this happen with PHP 5.2.4? If it does, update the version field
accordingly.
------------------------------------------------------------------------
[2006-09-01 17:54:55] 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
.....
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38682&edit=1