Re: [PHP] I can't echo object variables

2002-07-16 Thread Martin Clifford

Try enclosing it in curly braces.

echo p${db-field('name_long')};


Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


 Michael Zornek [EMAIL PROTECTED] 07/16/02 01:45PM 
We all know this works:

echo p$someVar;

However this does not:

echo p$db-field('name_long');

I know this slight variation will make it work:

echo p . $db-field('name_long');

But it's cumbersome .. Anyway to get the first way to work?

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org 

Personal Site: 
http://www.mikezornek.com 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] I can't echo object variables

2002-07-16 Thread Michael Zornek

Twas 7/16/02 1:47 PM, when Martin Clifford [EMAIL PROTECTED] said:

 Try enclosing it in curly braces.
 
 echo p${db-field('name_long')};

Parse error :-(

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] I can't echo object variables

2002-07-16 Thread Alberto Serra

ðÒÉ×ÅÔ!

Michael Zornek wrote:
 We all know this works:
 
 echo p$someVar;
 
 However this does not:
 
 echo p$db-field('name_long');
 
 I know this slight variation will make it work:
 
 echo p . $db-field('name_long');
 
 But it's cumbersome .. Anyway to get the first way to work?
 
 ~ Mike

In your example you try and execute a method within a quoted string. 
That would not work even with a traditional function call, AFAIK.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] I can't echo object variables

2002-07-16 Thread Analysis Solutions

On Tue, Jul 16, 2002 at 01:45:01PM -0400, Michael Zornek wrote:
 
 I know this slight variation will make it work:
 
 echo p . $db-field('name_long');

That's not an object variable name.  That's a function call.  You're
asking to echo p and then echoing the value returned by the field()  
function in the $db object when called with the 'name_long' argument.

That's the way you have to do it.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php