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
{

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

quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...

I often see an exa

TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to p

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

Small problem with image resize script
Hi!

I am a little bit new to php and I have an issue installing an image resize script I down

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID

Problems with array
This code is the last lines in an upload script that uploads 4 images at the same time and writes th

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

Show message after entering data
Hello Colleagues

I would like to display messages after entering the data example: "
dat

Disable Scrollbar in TableControl
Hello everbody,

please can anybody help me - outherwise i'm going to become desperate :P<

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