Echoing a Variable from a Object


Posted on 16th Feb 2014 07:03 pm by admin

How do I get a variable from the new User Class to echo out in this clasS?

class MyApp
{
Did you know?Explore Trending and Topic pages for more stories like this.

function __construct()
{
global $dbHost;
global $dbUser;
global $dbPass;
global $dbName;

$this->DB = new Database;
$this->DB->connect($dbHost, $dbUser, $dbPass, $dbName);

$User = new User;

echo $User->login;
echo $this->User->login;

}


}

No comments posted yet

Your Answer:

Login to answer
271 Like 8 Dislike
Previous forums Next forums
Other forums

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

MySql timezone
Code: $sql = "SELECT *, date_format(date, '%m/%d/%Y at %I:%i %p' )as date FROM comments WHERE t

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

I need an iframe that calls up a different page according to the date
hi

I don't know any php (only html) and I urgently need to do the following:

I need a

Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I n

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

php/xmlrpc class issue
I am working on xml-rpc in php to start with.

I have a class that only has variables defined

Problem with a select distinct
I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d fr

convert static html data into dynamic
hi all

i need to convert a website which has static above 2000 articles into dynamic and add

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash