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

DirectoryIterator and Hacked Website
Hi Everyone.

My problem:
Some one has been sneaking in to my website hidden Iframes. I've

Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let s

Keeping data in form
How can I keep whatever I write in the form?

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

SuperCali PHP Event Calendar
does anyone have any experience with the SuperCali PHP Event Calendar? I could use some assistance

PHP & Java
Hello,

can PHP code be used inside java code?

Code: <SCRIPT LANGUAGE="Java

Creation of Raw Exposure manually
SAP Gurus

I am creating Raw Exposure ( Hedge management ) thru T Code TEM10 with followin

Sessions work for me and not others?
I'm having a bit of bad luck with sessions. In the past they have worked fine for me, but this time

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