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

Mysql query, two times?
Hello to all,

I'm new to php coding and i like it alot. I need help with some noob stuff.

Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want

Script not running properly
Hello Everyone
This is a basic script for posting to a database. I'm not sure why it doesn't work

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.

But

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

user validation always displaying invalid ? please help
Hello,

I have 2 accounts and there is a field in mysql called validated it can be either &quo

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