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

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

Multi Dimensional Array Append
Hi Guys

I have a function that returns a multidimentional array eg

$result = functio

Multiple upload and Resize
I would like some help on my script I have the for my index.php

////

<html&

Finding digits in variable containing text, and IDing them
$romanstock = "http://www.remoteprice.com/data.asp?storeid=123&itemcode=456&typ

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

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