Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

class Database
{
public static $_instance;

public static function getInstance()
{
if(!isset(self::$_instance))
self::$_instance = new Database(DB_SERVER, DB_USER,
DB_PASS, DB_NAME);
print_r(self::$_instance);
return self::$_instance;
}
}
can any one explain "self::$_instance = new
Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);" this line

Answer Posted / guest

self::$_instance = new
Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);

It represents object creation of the class 'Database'.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is php stack?

902


Echo is used to Display message on screen. Which is used with echo to not output the trailing newline?

1004


Do you know what's the difference between __sleep and __wakeup?

957


What is the difference between for and foreach?

1054


Is php a cms?

924


Write a program using while loop in php?

950


What is reference variable php?

966


What is the difference between runtime exception and compile time exception?

1037


What is delimiter php?

948


What is the purpose of using php?

1011


Tell me which function gives us the number of affected entries by a query?

969


How to call php function from javascript using ajax?

948


How can we access the data sent through the url with the post method?

904


Write a program to swap two numbers using php.

1009


What is default session time and path in PHP. How to change it?

980