joomla1.5joomla-dbo

difference b/w &JFactory::getDBO() and JFactory::getDBO()


What is the difference between &JFactory::getDBO() and JFactory::getDBO() in Joomla 1.5?


Solution

  • 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().