Questions tagged [mysql]
MySQL is a database system used by many websites on the Internet. Joomla is based on PHP and MySQL.
289 questions
0 votes
1 answer
39 views
Why does com_finder (Smart Search) require SQL ALTER privileges in production? Can this be avoided?
We run a Joomla 5 website on a professionally managed server. On our production environment, the MySQL account used by Joomla has intentionally limited privileges — only SELECT, INSERT, UPDATE, DELETE ...
0 votes
1 answer
42 views
Joomla 5 Compatibility on AlmaLinux 9 Shared Server
In short, does anybody know if AlmaLinux 9 is fully compatible with Joomla 5, or if there are any issues I need to be aware of? We currently have 3 websites being hosted on a Bluehost shared web ...
1 vote
1 answer
65 views
Joomla 4.x - Query chaining with MySQL subqueries
I need to convert a MySql query with subqueries to “chained query” format for Joomla. First of all: I am aware that the query can be rewritten without subqueries, but as a matter of performance I ...
0 votes
0 answers
67 views
Reading several database tables at the same time
A page on my website needs data from the #__edition table and also from at two variables that are currently inside a separate table in the same database but could be moved to a different location if ...
1 vote
1 answer
75 views
Joomla! 5 Unknown column 'id = 1' in 'where clause' error
I am trying to connect to the #__contact_details db and get some info from there for a custom module. public function getContact(Registry $params, SiteApplication $app) { $db = Factory::...
0 votes
3 answers
109 views
Can't use method return value in write context - What is the problem?
I have found several reports of this message being associated with PHP 5.5 and 'empty()' and also containing the word 'function' in place of 'method' but they don't seem related to my instance. My ...
0 votes
0 answers
226 views
_template_styles' doesn't exist
I'm getting a weird error; here is the data below. I'll first start by telling you what I did and why. I have a client with a hacked Joomla site. For safety's sake, I installed a new Joomla and all of ...
1 vote
2 answers
248 views
Best way to save timestamp for new or modified records in custom component
In my custom component I have two database tables for items in my component with the standard 'created' and 'modified' datetime columns to contain timestamps when those items are created or modified. ...
0 votes
1 answer
50 views
Subquery error when using 3rd Normal form - 500 Operand should contain 1 column(s)
I'm fighting to get the following structure to work. I have three tables: players, player_teams, teams I used the conclusion I've found here for one of my questions: Join one to many with helper table ...
1 vote
1 answer
352 views
Standalone PHP script to get username in Joomla 4?
In Joomla 3 I used the following code. What do I need to change to use it with Joomla 4? <?php define( 'DS', DIRECTORY_SEPARATOR ); $rootFolder = explode(DS,dirname(__FILE__)); //current level ...
2 votes
2 answers
185 views
Is insertObject sanitizing the inputs?
Let's suppose I want to insert a new record into a table. Let's suppose that the table is of the structure of mytable(id, my_text); So, for example, we are to insert a new record, I would like to ...
0 votes
1 answer
687 views
MySQL "LOAD DATA LOCAL INFILE" with database connection object in Joomla 4
In order to import large CSV files into a Joomla database table, I use the MySQL "LOAD DATA LOCAL INFILE" command as follows: $db = $this->getDbo(); $sql = "LOAD DATA LOCAL INFILE '&...
0 votes
1 answer
244 views
Using MySQL "LOAD DATA LOCAL INFILE" with the Joomla database connection object
In a Joomla 3 component I use the MySQL "LOAD DATA LOCAL INFILE" command to import large CSV files into a Joomla database table. When moving to a new server, it is no longer possible to ...
0 votes
2 answers
85 views
UNION Query with loadAssocList($key)
So here is a small example of the query I play around with: $db->setQuery('SELECT position, title FROM jos_modules UNION ( SELECT position, title FROM jos_modules )'); $data= $db->loadAssocList()...
1 vote
1 answer
422 views
Joomla 4.3.1 Web installer fails to find MariaDB (MySQL) or PostGreSQL 11
I am trying to install Joomla 4.3.1 on my Ubuntu 18.04 machine. I am running Apache 2.4.57, PHP 7.4 (for Apache, apparently), PHP 8.2 is also installed, and two installations of PostGreSQL: 10.4 (...