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

PHP Tab Control
Hi All,

I would like to have PHP tab control with/without Javascript.

But I want to r

Recognising Revenue daily
Hello.
Has anyone come across daily recognition of deferred income?
We want to implement R

Month String to Numeric?
Hi guys,

Given a month as a string, is there a simple way to find the numeric representation

please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row

Switch letters in message (basic cryptology)...
I am trying to switch letters around in a message for an application on my site (see here). The prob

Php script to read msword file
hi,

I need to read a msword file and i want to print the contents in that word file.

i

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 p

Business Health Check
Hello

I need to create an online business health check for a client it will be multiple choi

Display a default image
I am trying to display generic image for items that don't have one, but I can't get it to display.

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