4

Joomla 3.9.x has a file public_html/libraries/classmap.php that contains all the old style Class names, and the new replacements. E.g. JLoader::registerAlias('JFactory', '\\Joomla\\CMS\\Factory', '5.0'); JFactory is indeed deprecated. You can rewrite // JFactory is deprecated $db = JFactory::getDbo(); to // Put at the top of your file use Joomla\CMS\...


4

Using array_chunk() with the row count cut in half then rounded-up will ensure that the second column always has equal or one less row than the first column. HTML tables should only be used to display "tabular" data. Since you are building two non-tabular lists, it would be more appropriate to employ other tags (several different tags may be appropriate). ...


3

Found the answer. When I renamed the database I also had to re-assign the database user to this database.


3

What is likely to be tripping you up is that your $tableArray doesn't have prefixes. This is evident in your query because you prepend the tablename with #__ in the FROM clause. The resultset will be delivering the rendered prefix with the tablename, so your input array values will not match the result set values. *Important: Always try to avoid iterated ...


2

One of the last steps in the update process is to apply any schema changes, after files are copied in. If the one-click update fails, then the schema changes might not have been applied. This will result in warnings that your database is not up to date with the code. Navigate to Extensions > Manage > Database. If this is the problem, then you should see a ...


2

Your comment led me to doubt my belief that getDbo() is alive and well. I have tested my below techniques on Joomla3.9.5 and there are no problems. Original answer... Based on this documentation: https://api.joomla.org/cms-3/classes/Joomla.CMS.Factory.html#method_getDbo Returns the global \JDatabaseDriver object, only creating it if it doesn't already ...


1

Your issue comes solely from confusion about Joomla! versions. These facts should clear the air: \Joomla\CMS\Factory::getDbo() is deprecated in 4.0 and will be removed in 5.0. It is alive and well in 3.9. \Joomla\CMS\Factory::getContainer() doesn't exist in 3.9 as it was only added in 4.0. The code you were looking at is from 4.0, not from 3.9.5. In ...


1

I had this issue now a second time on another system and tried to fix it the same way. I've recognized, that this could be fixed easier: Setup a new local Sytem of Joomla with the last running Joomla version (which was 3.9.3 in this case) Exported the database from the live system and imported it to my local Joomla Repaired all database failures with the ...


1

Yep. Official doc https://docs.joomla.org/Connecting_to_an_external_database Also note this question has been asked before. E.G. I am trying to connect two database with one Joomla site


1

When using SHOW TABLES load results with loadColumn() to receive a simple array with table names as values. print_r(JFactory::getDbo()->setQuery('SHOW TABLES')->loadColumn()); Output: Array ( [0] => tbl_assets [1] => tbl_associations [2] => tbl_banner_clients [3] => tbl_banner_tracks [4] => tbl_banners ... )


1

If you're in case of a failed upgrade you can check out this tutorial to manual upgrade a Joomla Installation. https://gist.github.com/mbabker/d7bfb4e1e2fbc6b7815a733607f89281 It sometimes helps to get out of failed upgrade or at least bring access back to your administrator interface. This method has been referenced by the community when having trouble ...


1

I'll offer my version of the snippet then explain my justification and include quotes from the Joomla Coding Standards manual (which will be quoteblock formatted). $subquery = $db->getQuery(true) ->select("checkin") ->from("#__sub_table") ->where("subTest = 1"); $query = $db->getQuery(true) ->select("*") ->from("#...


Only top voted, non community-wiki answers of a minimum length are eligible