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

Calling variables
I want to call this to my website but it doesn't display what I want it to,

Code: <h5&

Display the user's weight lost in the past week
Hello everyone,

I am working on a weight loss app for my site, and I want to display the user

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

Calander Basic Spript help
hi, just starting out with PHP and have the following script:

<?php
//This gets t

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

HTML Form Server Side Validation
Hi, Im new here, im currently doing a website for a friend, and I have designed using snippets from

Error when call dll from oracle
Hi all, please help me!

I have dll write C language, I want call it from oracle procedur

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

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