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

MVC - Code review
I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to impl

getting Vars to pass to next page.
Hello all,
I have a confusing situation on my hands, i am a member of a gaming community and we

Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where a

please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row

how to transport the Query and insfoset
Hi

I have created the query using SQ01........
How to created T-code for query..

Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki

i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ

[PHP HELP] Php order form.
Hello to everyone @ phpfreaks. Im new to this site and hope to learn lots of things here.

Fir

New Search Engine
Hey everyone,

I have a ZIP Code Radius search engine already functional. it displays all of t

Help with Contact Form
I have this Form on an html page and the associated code on page.php (below).
I keep getting the

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