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

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

Gerenate tabel in Php
I whant to generate a tabel takeing data from database like this one so the results to be display on

Filename and Line Number Custom Error
I have a class, with a method that accepts 2 parameters. I would like to output error messages.

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

I got my hosting suspended XD
So I saw this challenge a day or so ago

http://www.programming-challenges.com/pg.php?page=dow

OPINIONS WANTED
This is my login page code, and I want your opinion on it please!

Code: // Login ~ CHECKS

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

Retrieving Data from Two Different Databases
Hello All,

Ran into another problem and would appreciate some help! I have two datab

Can't get the unicode character
I'm trying to get some text from various parts of a file. I have converted the file to hex (bin2hex)

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