9 votes

JFactory::getDbo() deprecated-- what's the replacement?

If you are developing your extension only for Joomla 4.0+, you can replace $db = Factory::getDbo(); with $db = Factory::getContainer()->get('DatabaseDriver');
akfaisel's user avatar
  • 121
8 votes

Adding Multiple Users in Joomla

I see in the tags of your question you are using mysql and phpmyadmin, so I assume you are after a a way to INSERT records of users directly into the Joomla database. However please note that, the ...
FFrewin's user avatar
  • 19.7k
8 votes

JFactory::getDbo() deprecated-- what's the replacement?

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....
pe7er's user avatar
  • 2,023
6 votes
Accepted

with insert on duplicate key update - updating multiple rows at once

Building a REPLACE INTO query is just as simple as building an INSERT ... ON DUPLICATE KEY UPDATE. Note that there is a difference between REPLACE INTO AND ON DUPLICATE KEY UPDATE. Code: $columns = ...
mickmackusa's user avatar
  • 4,791
6 votes
Accepted

JFactory::getDbo() deprecated-- what's the replacement?

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 ...
Sharky's user avatar
  • 11.2k
6 votes
Accepted

Create a table observer

This was working ok on my instance Joomla 3.9.22 with PHP 7.3.5 (and mysql). Then to test this I selected PHP 7.0.33 instead and it gave me an error: Fatal error: Declaration of MyObserver::...
Robbie Jackson's user avatar
6 votes

Restoring with Akeeba to a new site on cpanel

Yes you will need to enter the details for the development server database at this step. By default, Akeeba Kickstart will display the database details from the site it was backed up from... it ...
Snaffle's user avatar
  • 146
6 votes
Accepted

Change database password?

The correct method is to update database password first, either via your hosting control panel or the command line. Then manually update the password in configuration.php either through the File ...
Snaffle's user avatar
  • 146
5 votes
Accepted

What is Joomla article options stored table?

The data you are looking for is available in same table (#__content) and you will find all the options in attribs column. Note that in MySQL the table will have the db table prefix that you have ...
Joomler's user avatar
  • 1,811
4 votes

Migrate users account from Joomla 3 to another Joomla 3 manually

Rather than migrating the users manually you could try some of the extensions available at Joomla Extensions Directory. This page contains several extensions, both free and commercial, you'd have to ...
johanpw's user avatar
  • 13.3k
4 votes
Accepted

Migrate meta keywords to tags

We have developed a script that does that and that can be found here. Essentially, we loop through articles and then we grab the keywords, add them as tags, and then tag the articles. We have mainly ...
itoctopus's user avatar
  • 3,226
4 votes

Extension to edit multiple articles in a same pattern?

Actually you said it - you need to change the content in the database. For doing such thing from within Joomla, Regular Labs DB Replacer Pro is the tool to use. Supporting regex searches, will allow ...
FFrewin's user avatar
  • 19.7k
4 votes

Why my custom query only returns one result?

You should use loadColumn instead of loadResult. loadResult is used when you want to get only 1 value from the query (and is typically used when the query returns just one value), loadColumn is used ...
itoctopus's user avatar
  • 3,226
4 votes

How to check if specific table names exist in a database?

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 ...
mickmackusa's user avatar
  • 4,791
4 votes
Accepted

How to separate database results into 2 columns?

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 ...
mickmackusa's user avatar
  • 4,791
4 votes

Migrating custom module to Joomla 4

Lodder's answer is fully valid, however he did not want to waste time to reformulate the query part of this old script in the question. As a morning drill during my coffee time I corrected that part ...
Zollie's user avatar
  • 2,936
3 votes

How can I get the names of the columns in an object or table with Joomla's SQL?

To get all columns of a table as arrays use JDatabase class method as follows: $db=JFactory::getDBO(); $columnArr=$db->getTableColumns("#__table_name"); foreach ($columnArr as $key => $value) { ...
Pratyush's user avatar
  • 496
3 votes

How to share table between 2 or more databases?

Yes, you can share the users from one Joomla! site to multiple other Joomla! sites (as long as you keep them on the same J! version). This is how you do it in Joomla! 2.5 - 3.6 (current version): ...
Michael Yaeger's user avatar
3 votes

Joomla Debug Console does not show Database Queries

This is kinda of necroposting, but an issue still has no fix from Falang author, so here is it. In the file ./plugins/system/falangdriver/falangdriver.php Find (309 row for Falang 2.6.0): $db->...
Shader's user avatar
  • 31
3 votes
Accepted

Joomla Debug Console does not show Database Queries

Found out that the joomla database driver is being overridden by another one which belongs to Falang component that allows you to manage all the content translations. Falang database driver has no ...
Aung Myo Linn's user avatar
3 votes

Website for Famous People Profile Database

From my experiences, extending from an available component can be difficult to maintain in the long run. And extending from the component could be a hassle as the coding style are different and ...
Norman's user avatar
  • 131
3 votes

Are there any alternatives to Fabrik for building a database application (ERM/CRM)?

I've used Fabrik for a few projects in the past but for my most recent project I ended up using ChronoForms. I've used ChronoForms in the past but until recently didn't realize that it's capable of ...
Insider Pro's user avatar
3 votes
Accepted

How to create bulk articles by using php script?

I also faced the similar issue once and I modified the code as following which worked for me. You also need to pass the access and metadata in the article parameters. $article_data = array( 'id' =...
Liz.'s user avatar
  • 1,385
3 votes

How can I increase the maximum length of article titles?

After reading the comments under your question: You could modify the #__content.title column but bear in mind that this involves a potential risk of data lοss if a future Joomla update contains ...
FFrewin's user avatar
  • 19.7k
3 votes
Accepted

Check if INSERT query was successful or failed because of a duplicate UNIQUE KEY

You will need to perform a select query against your database table, searching for the email address. If a result is returned, you can throw an alert message, else perform the insert query, something ...
Lodder's user avatar
  • 26.9k
3 votes
Accepted

How to check if specific table names exist in a database?

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 ( ...
Sharky's user avatar
  • 11.2k
3 votes
Accepted

Joomla 3.9.3 Articles: 500 Unknown column 'a.note' in 'field list'

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 ...
Patrick Münster's user avatar
3 votes
Accepted

Failed to Read Session Data After Renaming DB

Found the answer. When I renamed the database I also had to re-assign the database user to this database.
jonboy's user avatar
  • 3,603
3 votes

Linking JOOMLA! database to a flutter application

To connect Joomla! to a 3rd party app you will need an API connection. There are a few options: You can install Jbackend on Joomla and use rest API to access the database. https://extensions.joomla....
James Koen's user avatar
3 votes
Accepted

Json encoding being escaped

json_encode() is correctly doing its thing. Double quoting is used to isolated keys and values; any double quotes inside of these data points must be escaped to maintain the integrity of the data (...
mickmackusa's user avatar
  • 4,791

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