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

Thread in PHP
Thread in PHP
Some basic use and basic code for thread in php
This is my question?

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

Help with simple query
Hi,

I'm trying to do a Query with a Union where I want to print the number of rows $tc conta

Change Web page language
i doing this thing first time but i dont find any suitable solution for it. On the demand of user. I

$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable

IS Retail & Manufacturing
Hi

Can IS Retail and Manufacturing activities be done in same instance ie. in same client

How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.

H

Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like

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