difference b/w &JFactory::getDBO() and JFactory::getDBO()
What is the difference between &JFactory开发者_开发技巧::getDBO()
and JFactory::getDBO()
in Joomla 1.5?
The difference is not a Joomla one, but PHP. In PHP, the ampersand means that instead of assigning the actual value, the value will be passed by reference. This is important, because you don't want a copy of the database, you want the global database object. Thus, one should use $db =&JFactory::getDBO()
.
精彩评论