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

Count on multidimensional array
Hi, i got an array as below:

Array
(
=> Array
(

please fix the error
What is the error in the below code ???
Line number On/Off | Expand/Contract <?php

Remove Rows From Database ad
Hi All,

I have this:

Code: [Select]<?php
session_start();
include('../com

Code working in IE but not FireFox
I created a dynamic navigation list for my website based off of a table in my database. The code is

uploading video files into mysql in php
hi,
I have the video files which i have to upload into mysql db. along with creating thumbnails f

Paypal
Hi all,

I have an advanced basic knowledge of php

I want to try something new for a s

how to export excel file in same server
My first post - php newbie, so appreciate your support.

I'm currently using headers to save w

mail() problem
Hi Guys,

I've set up a contact email form. It sends the information fine, but it sends it to

Posting Serialized Data Not Working
I am trying to send an object from one PHP file to another using POST. I serialize the object and th

SMTP server...
I recently found a tutorial online on SMTP authentification for sending emails from webpages, here i

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