Re: $ObjectName->SearchResults[Results Index] -> whatever_name
| From: | Stanislav Okhvat | Date: | Wed, 10 Jul 2002 04:12:59 +0000 |
| Subject: | Re: $ObjectName->SearchResults[Results Index] -> whatever_name | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1832@lists.php.net to get a copy of this message | ||
Hi, Alexander,
PHP can only correctly handle things like
$ObjectName->SearchResults[ResultsIndex]->$var in version PHP 4.3
(which is now in beta). That's what I heard, although I might be
wrong. You will need to either use 2 statements:
$obj =& $ObjectName->SearchResults[ResultsIndex];
$myvalue = $obj->$var;
Hope this helps,
Stanislav
==========
AC> Hello,
AC> I'm using PEAR DB libraries and have a Object property which is a copy
AC> from a query. Hence the format of the property
$ObjectName->>SearchResults[Results Index] -> whatever_name
AC> problem is I need to retrieve the values dynamically so I'm trying to
AC> put the statement together by changing 'whatever_name' with $key as
AC> shown below:
$ObjectName->>SearchResults[Results Index] -> $key
AC> I've tried using eval() but this does not seem to retrieve the object's
AC> property any ideas? Am I doing something wrong.
AC> Yours
AC> Alex
Best regards,
Stanislav mailto:stanis@sibfair.nsk.su