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
{
Did you know?Explore Trending and Topic pages for more stories like this.

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

Socket Server
In my following socket server, I am trying to listen to a connection through port 12345 in my web br

Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav

dynamic table with forms
I have a table that is populated with mysql data and in teh first column there is a raido button tha

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I

Exporting new records
Trying to figure out the best way to set this up.

People register my site.

Their prof

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

IIS & NW MII on the same server
Hi,

We're weighing the possibility to run both IIS and MII (NetWeaver) on the same server

$GPRMC and NMEA how to extract from report
Hi There,

Im a little bi lost and not sure where to start with this one, ive got a small gps

convert PHP array to Javascript array
I have a page that gets a request sent from AJAX, and I am trying to convert a PHP array to a javasc

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