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();
// Put at the top of your file
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).
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 ...
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 ...
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.
Based on this documentation:
Returns the global \JDatabaseDriver object, only creating it if it doesn't already ...
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.
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 ...
When using SHOW TABLES load results with loadColumn() to receive a simple array with table names as values.
 => tbl_assets
 => tbl_associations
 => tbl_banner_clients
 => tbl_banner_tracks
 => tbl_banners
If you're in case of a failed upgrade you can check out this tutorial to manual upgrade a Joomla Installation.
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 ...
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)
->where("subTest = 1");
$query = $db->getQuery(true)