Re: Accessing $vars from within a class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do you mean this?

function hello() {
	$sql = 'select * from table';
	return($sql); // return the variable to make it available outside the function
}

class ABC {
	function a() {
		// How can I access hello()'s $sql?
		$localSQL = hello(); // get value of $sql returned from hello();
	}
}

HTH

-jmb


Andres Santos wrote:
> Hi,
>
> Im trying to get the $sql variable value from hello() in a()
>
> function hello() {
> 	$sql = 'select * from table';
> }
>
> class ABC {
> 	function a() {
> 		// How can I access hello()'s $sql?
> 	}
> }
>
> Is there a way to do that? By referencing the variable or something like that?
> Thanks, Andres
>
>
>
> PHP Data object relational mapping generator
> http://www.metastorage.net/ 
> Yahoo! Groups Links
>
>
>
>  
>
>
>
>
>   



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux