// Include Joomla framework define('_JEXEC', 1); define('JPATH_BASE', realpath(dirname(__FILE__))); require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; // Get the database object $db = JFactory::getDbo(); // Create a new query object $query = $db->getQuery(true); // Build the query $query->select('*')->from($db->quoteName('#__tablename'))->where($db->quoteName('column') . ' = ' . $db->quote('value')); // Set the query $db->setQuery($query); // Fetch data $result = $db->loadAssocList();
// Include Joomla framework define('_JEXEC', 1); define('JPATH_BASE', realpath(dirname(__FILE__))); require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; // Get the database object $db = JFactory::getDbo(); // Run a custom query $query = "SELECT * FROM #__tablename WHERE column = 'value'"; $db->setQuery($query); // Fetch data $result = $db->loadAssocList();The JFactory getDbo method is part of the Joomla Framework's Database package/library. It is specifically located in the JFactory class within the framework's source code.