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

Unifying logins of two different scripts
I have two different game scripts which I want to embed on my own site. The problem is I don't want

problems with search form numerical "between" sending by php
I am trying to display the results of a search, on a sql database, on a web page. I set up html &quo

Issue Parsing XML into table
Hello all,

Im a bit new to php and new to phpfreaks. But thanks in advance for the help!
<

text box alphanumeric caracters only
hi all!

I have search on google on how to enter in a test box only caracters A-Z,a-z,0-9 usi

Strange HTML Tag?
I recently noticed some odd HTML appear in some of the websites I host. Not all of them are run on a

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

How to form a xml form table with a single sql statement..?
Hi everyone,
I don't know if this is going to be a duplicate thread but i couldn't

Multi dimensional arrays
If I put in this code:

1
2
3
4
5
6
7
8
9
10
11
12
13<

Contents of variable not echoing
Hey guys, hopefully this is an easy one...

In this line, the variables are not echoing out. T

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

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