Skip to main content

Questions tagged [database]

A database is an organized collection of data typically used to model certain situations. Use this tag if you have questions about designing a database. If it is about a particular database management system, (e.g., MySQL), please use that tag instead.

Filter by
Sorted by
Tagged with
1 vote
1 answer
37 views

Query with multiple joins and a variable

I have a query: $query->select( $db->quoteName( array_keys($fields), array_values($fields) )); $query->from($db->quoteName('#__receipts_patient_charge',...
0 votes
0 answers
27 views

problems with updating database

I have some code to update a table: $updateLastAttempt = new stdClass(); $tempDate = new DateTime('now'); $formattedDate = $tempDate->format('Y-m-d H:i:s'); $updateLastAttempt->id = $pxobjUpdate-...
2 votes
1 answer
131 views

Joomla MEMORY tables cause an error in creating/editing articles

I am encountering an error with Joomla 4 that has never occurred to me in previous installations. When I try to create/edit an article, a category or to index contents in smart search, I get the ...
0 votes
1 answer
48 views

DB error using updateObject or Store after upgrading to Joomla 4

I am a component developer and now I am migrating my component to Joomla 4.x. In Joomla 3.x I could do code like: $row= new stdClass(); $row->id = "2"; $row->user_id = ""; $...
0 votes
1 answer
37 views

I am new to Joomla and I'm trying to figure out if I need to install the software or if I can just log in online to make changes

I recently started a summer job and it requires some website management. The company that hired me already has their website through Joomla! and I am just trying to figure out if I need to download ...
1 vote
2 answers
641 views

UPDATE query to add 1 to multiple columns

I have a website for my football team. I have some statistics and so on in there, for example how many games each player has played and so on. What I would like, is for me to write in the names of ...
4 votes
3 answers
502 views

Joomla 4 Smart Search: Extra database for indexing data

I'm just about to migrate my site from Joomla 3 to Joomla 4. It's a pretty big website with thousands of articles that leads to problems using the new Joomla smart search. The indexing of the articles ...
0 votes
1 answer
83 views

Dynamic Form based on Signed in User

I am a total noob in coding. Back in engineering school we had some coding classes and I was good at it but I never really focused on that. I know some python and c# and that is about it. I have a ...
3 votes
0 answers
71 views

Joomla 4 Pre-Update Check Database Fail

I installed Joomla on my webhost (Siteground) using the one-click installer package. I'm currently on v4.3.2 Everything appears to be working as expected apart from the Joomla update option. It keeps ...
0 votes
0 answers
30 views

How to know about errors when using Table class store method without using getError

I'm wondering how to find errors when a table class is used, inheriting from \Joomla\CMS\Table and using the store method? It appears that in Table, the store method traps errors in a try-catch ...
2 votes
2 answers
121 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
362 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
2 answers
35 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()...
2 votes
2 answers
134 views

Query with INTERVAL won't work

I have the following query: $query->select('date') ->from('#__db_reports') ->where($db->quote('date < NOW() - INTERVAL 30 DAY')) $db->setQuery($...
3 votes
2 answers
2k views

Connect two databases with one Joomla site

I have two Joomla sites with different databases. I want to share all data from one site to another site. For example, when I register a user in one website then it's updated on the second site's ...
1 vote
1 answer
188 views

Change database password?

I am trying to change the Joomla database password. I cannot figure it out. If I change the password in the database first, then Joomla is unable to use it, because it no longer has access to the ...
3 votes
3 answers
438 views

Migrating custom module to Joomla 4

I have a Joomla 3.x module which calls the category name from the database and then shows this in the module position. It does this with: $db = &JFactory::getDBO(); $id = JRequest::...
1 vote
2 answers
133 views

loadObjectList() returns array indexed by empty string

Very simple query: $query = $db->getQuery(true) ->select('*') ->from('#__mail_templates') ->where('template_id = ' . $db->quote($this->getRowId())) ...
1 vote
1 answer
106 views

After joining two tables in phpMyAdmin how do I save the results as a dynamic table?

In order to query the exact featured status of an article in a blog override (i.e. currently featured, not pending or expired or not featured at all) I have created a query to join two tables and ...
0 votes
0 answers
250 views

Connecting to an external database in Joomla 4 - further problem

I have seen the earlier question on this subject and tried the suggested code: $db = (new Joomla\Database\DatabaseFactory)->getDriver('mysqli', $options); but get an error: An error has occurred ...
1 vote
0 answers
321 views

Tables and needed columns in Joomla 4

On the Page https://www.dionysopoulos.me/book/com-tables.html#com-tables-get-object I read: The table MUST have the following columns: parent_id. The primary key of the parent node. Provides ...
2 votes
1 answer
85 views

Strange Characters in Site Text

Joomla 4.2.5 PHP 8.0.26 I've just noticed there are strange characters appearing throughout my website text - such as ’s Some of my pages are created with SP Page Builder, others with the default ...
1 vote
1 answer
50 views

Customizing 'Item Saved' message in custom component

I'm trying to find a way to customize the message displayed after a successful record has been saved in a custom component. Well not really the entire message, just the 'item' part. For instance if my ...
1 vote
1 answer
953 views

Connecting to an external database in Joomla 4

Connecting to an external database in Joomla 3 is easy following this documentation and works like a charm. But JDatabaseDriver->getInstance method is deprecated in Joomla 4. What is the ...
1 vote
1 answer
161 views

How do I insert multiple records?

First, I took user_id, name, and email for the #__users table and joined with custom #__field_values lot, address, and phone. $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->...
0 votes
0 answers
197 views

An exception occurred while executing 'INSERT INTO

I am trying to sign up in a portal but I am getting the following error; "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null How do I solve this problem?
4 votes
1 answer
7k views

What is the difference between mysqli and mysqlnd php extensions?

I'm considering upgrading from PHP7.4 to PHP8.0 on a Joomla 3.10.8 installation. I was surprised to find that my hosting provider only offers mysqlnd as a PHP extension in PHP 8.0, but not mysqli. ...
3 votes
2 answers
1k views

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

All I want to do is check if a table exists or not and I can't figure it out. I've tried: for ($r = 0; $r < count($tableArray); $r++) { $db = JFactory::getDbo(); $query = $db->getQuery(...
1 vote
1 answer
23 views

Omit previously imported articles by comparing existing articles aliases with generated aliases

I am needing to compare the generated articles aliases of items imported from an external news API against those that are already stored in the com_content database to ensure that duplicates are ...
2 votes
0 answers
115 views

Transfer of the site, with change of the database (MySQL to MariaDB)

I built my website with Joomla4 and a MySQL8.0 database. Unfortunately, I need to transfer my site to a server using MariaDB10.4, which isn't compatible with MySQL8.0. I'm not a programmer and ...
3 votes
2 answers
734 views

Linking JOOMLA! database to a flutter application

I created a Joomla website which has some forms to be filled. Is it possible to link this form to a database that a flutter mobile application I developed can retrieve data from? For example, the ...
0 votes
0 answers
54 views

How to display value from a specific field in the db?

I want to display the com_tags tag title in a module while on the "Tagged Items" menu item page. My goal is for this code to display the title for the current tag. For example, when on ...
5 votes
4 answers
7k views

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

I'm running Joomla 3.9.5 and I'm attempting to update my JFactory::getDbo() calls (which are deprecated) to the newer format using the container. However, I'm getting the following error: Call to ...
2 votes
1 answer
88 views

Restoring with Akeeba to a new site on cpanel

I've backed up my Joomla site with Akeeba, and I'm using Akeeba Kickstart to put the site into a dev environment on a different server with its own cpanel. The dev server has its own database and ...
1 vote
1 answer
423 views

JTable, new row doesn't get inserted with table->save method

I'm trying to insert a row with the table->save() method, but the method executes an UPDATE instead. There is no row available, so it needs to be inserted. Does anyone know how to get it inserted? ...
1 vote
0 answers
142 views

Table data are not shown in the depended field - BreezingForms - Mariadb [closed]

I have 2 set of fields: Set A (Field1, Field2), and Set B (Field3, Field4). Field1 loads data from Mariadb tableA according to user selection and then loads the corresponding data from tableA to ...
2 votes
1 answer
99 views

using Ajax to save contents of html how to make safe

I am using com_Ajax to save the contents of my editor (front end of the website in a module) Ajax and passing the content of the editor all works fine. I am concerned about security. To get the data (...
2 votes
2 answers
55 views

Get the template I'm currently editing

I'm developing a custom form field for my template and I need to know the name of this template from inside this form field. While otherwise I would do a setQuery to look for client_id=0 and home=&...
1 vote
1 answer
87 views

Joomla Select from DB AND / OR grouping

I did not found any guide on how to handle such queries in Joomla: I would like to select all items from db which are: Published AND (the publish up date is 0000-00-00 00:00:00 or smaller then datenow)...
4 votes
1 answer
213 views

Create a table observer

I am trying to create a table observer in a module. I am using the Table Advanced API guide in the Joomla documentation https://docs.joomla.org/Table_Advanced_API_Guide. When I use the code provided, ...
5 votes
1 answer
875 views

Joomla SQL drivers and prepared statements

Can you tell me if Joomla SQL drivers support prepared statements? As far as I understand, the MySQLi driver does not prepare SQL statements. But Joomla also supports MySQL PDO driver. Does this ...
2 votes
2 answers
4k views

Failed to Read Session Data After Renaming DB

Joomla 3.9.11 Working on localhost, today I decided to rename my database from dbtest to dbnew. I did this using HeidiSQL > rename db When I visit my site I now see the following error; Warning: ...
0 votes
1 answer
32 views

Component development, on installing an update, should/could J! ignore some database errors?

While developing a component the database can go through many changes. Updating the component then either goes through many schema update files, or causes problems. Re-applying a database change file (...
2 votes
0 answers
60 views

writing my own code to import users

I need to batch create lots of users and I have their emails and some profile details like phone number and address. This data is in a google sheet. I just need to generate usernames and set initial ...
1 vote
1 answer
100 views

Where does Joomla com_tags store the ordering data?

I want to dump tags by order from the #__tags database table, but there is no order column in the structure, though there is ordering capability in the tags component. I've viewed the relevant files ...
2 votes
1 answer
52 views

Which files do i need to include to perform database query?

I am trying to practice Joomla database query. For learning purpose, I'd like to know in a blank PHP file under Joomla's root folder, which files do I need to include to be able to do $db = JFactory::...
0 votes
1 answer
110 views

How to install custom component sample data?

I have a custom component for Joomla. I understand how to install some data using the sql file of component. Now I want to add some data to the database tables in a separate package. I can't find any ...
1 vote
1 answer
121 views

Joomla database tables have duplicates that start with bak_

I have a Joomla website, and somehow, the database shows duplicate entries for every table row. The duplicates all start with bak_. I assume it was caused by some sort of backup process, but this has ...
0 votes
1 answer
35 views

Joomla DB where statement not works as expected

I don't understand the world right now. I try to make a simple query from the DB, but it fails with the message that the column is not known. I do not understand why Joomla! tries to see the value I ...
2 votes
3 answers
284 views

Cannot Connect To MSSQL Server

I am using php 7 and trying to connect to mssql server. I have this code: <?php $serverName = "server"; //serverName\instanceName $connectionInfo = array( "Database"=>"...

1
2 3 4 5