iloveny Posted March 11, 2007 Share Posted March 11, 2007 $db =DB::connect($datasource) if (DB::isError($db)) { die($db->getMessage()); } That was the code for connection to database. There are signs on first line and third line ('::' and '->'), what is that means and what you call that sign? many thanks in advanced!! Link to comment https://forums.phpfreaks.com/topic/42198-solved-new-to-php-got-a-question-about-sign/ Share on other sites More sharing options...
trq Posted March 11, 2007 Share Posted March 11, 2007 The :: lets you call a static method from within a class without having to instantiate an object first. The second -> lets you call an objects method. Assuming you are also new to OOP then alot of what I just said may or may not have gone straight over your head. For more info on classes and objects, take a look at this section of the manual. Link to comment https://forums.phpfreaks.com/topic/42198-solved-new-to-php-got-a-question-about-sign/#findComment-204699 Share on other sites More sharing options...
sspoke Posted March 11, 2007 Share Posted March 11, 2007 :: static -> dynamic good way to remmeber it Link to comment https://forums.phpfreaks.com/topic/42198-solved-new-to-php-got-a-question-about-sign/#findComment-204711 Share on other sites More sharing options...
iloveny Posted March 11, 2007 Author Share Posted March 11, 2007 thanks a lot guys! Link to comment https://forums.phpfreaks.com/topic/42198-solved-new-to-php-got-a-question-about-sign/#findComment-204873 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.