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
32 votes
4 answers
5k views

Method for creating a subquery using JDatabase

At http://docs.joomla.org/Selecting_data_using_JDatabase, there isn't a documented method for writing a subquery using JDatabase. https://gist.github.com/gunjanpatel/8663333 exemplifies one way of ...
betweenbrain's user avatar
1 vote
3 answers
2k views

select data from several tables in one query - how to control JOIN?

I'm building on my question here: Build a query with JOIN, but filter and sort that joined table first Now the goal has become more complicated and I can't solve it. Here's the problem: I'm building ...
michi's user avatar
  • 37
11 votes
1 answer
11k views

Can I use PostgreSQL with Joomla 3.3

Can I use PostgreSQL with Joomla a 3.3 production site (not for testing) and if so is there anything I should be aware of? I would appreciate some feedback from someone who has actual installed and ...
CoalaWeb's user avatar
  • 275
4 votes
2 answers
2k views

How to save image in specified folder in joomla directory and save file name in db

I am working on a custom component, where at the backend interface - we want the admin user to be able to upload image and let that image directly save to a specified folder - /images/uploads/variants/...
Ruchika's user avatar
  • 425
3 votes
2 answers
1k views

How to share table between 2 or more databases?

I have a Joomla! site and now I want to make some subdomains. But, I want that the users must be the same in both. Like, if a user logs on to the main site and then goes to the subdomain at the same ...
Murad's user avatar
  • 162
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 ...
Sanjay Yadav's user avatar
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($...
Thiago Guimarães's user avatar
17 votes
6 answers
30k views

How can I print out a Joomla query?

Suppose you have constructed a query with Joomla. // Get a db connection. $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); // Select all records from the ...
Mat Kay's user avatar
  • 760
6 votes
1 answer
864 views

Database query where() value is a number

As we know, any values that are defined in a database query should always be escaped in Joomla using $db->quote($value). When defining numbers as a variable, one would normally use (int) to set ...
Lodder's user avatar
  • 26.9k
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 ...
user101289's user avatar
  • 1,119
5 votes
2 answers
5k views

How to do SQL exception / error handling compatible with 2.5 and 3.x?

I was trying to develop Joomla 2.5 and 3 component. As many things deprecated between these two versions and the way to throw and catch database and other errors, I could not find ways yet to make ...
dev-m's user avatar
  • 1,351
4 votes
5 answers
5k views

MySQL error: Unknown storage engine 'InnoDB'

I have a couple of Joomla 3.3.6 websites, and suddenly this morning I started to get random error messages, like this: Error displaying the error page: Application Instantiation Error: Unknown ...
Bogowoe's user avatar
  • 1,178
4 votes
1 answer
2k views

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

With latest joomla version I try to achieve one query to the database and updating multiple rows at once. I want to make a query like this: INSERT INTO `tablename` (`id`,`date`) VALUES ('79','2018-...
user348246's user avatar
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 ...
mib1980's user avatar
  • 81
3 votes
2 answers
2k views

Adding Multiple Users in Joomla

How can to add multiple users in Joomla 3 without using an extension? Thank you! :)
Justin C's user avatar
3 votes
2 answers
3k views

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

I have a db-table called league where the mail column is the unique id: |name |mail | |Bryan|[email protected] | I have a frontend where users can sign up and then I have this for ...
Daniel Jensen's user avatar
3 votes
1 answer
1k views

How can I increase the maximum length of article titles?

I need to create a few articles with very long titles, but it seems like Joomla has a maximum article title length of around 256. How can I increase this limit?
Dan's user avatar
  • 341
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 ...
Nintendomi's user avatar
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=&...
thednp's user avatar
  • 415
2 votes
2 answers
727 views

Transform PHP SQL to Joomla SQL query

I am moving a PHP page to my Joomla website and I was advised that I "should use Joomla's coding standards and methods for everything, this includes database queries" My question is: How should I ...
Teodor Bochev's user avatar
2 votes
2 answers
3k views

How to save checkbox values in a table?

How can i insert data from a html form to a table in Joomla database. Sample code of the form: Name : <input type="textbox" name="username"> Selection1 : <input type="checkbox" name="choice1" ...
saibbyweb's user avatar
  • 2,289
2 votes
1 answer
1k views

What is Joomla article options stored table?

I am searching where in the database (table, column) are stored the choices we make at Option tab, when editing an article. To be more specific I was looking to see where is the "Show Author" (Show ...
geoplous's user avatar
  • 359
2 votes
1 answer
187 views

Save multiple fields in DB

Please help advice. How to save multiple Fields in the database. I have a form with X number of fields. Fields added using JQuery <input type="text" value="" name="jform[phone]"> <input type=...
RQEST's user avatar
  • 33
1 vote
2 answers
4k views

Fix database after failed update

So, I recently had an issue with a failure with updating to Joomla 3.6.5. It looks like I was mostly able to recover from the error by manually updating, however there seem to be issues with the ...
nizz0k's user avatar
  • 537
1 vote
1 answer
253 views

Charts/Graphs for RSFORM using mysql for VChart and/or PlotaLot

I am working for a homeless organisation in Capetown. We are using RSForms to register our clients (about 3500 per year). We have a sizable database, but it's very hard to create a dashboard. We are ...
Gart's user avatar
  • 47
1 vote
2 answers
132 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())) ...
Olle Härstedt's user avatar
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 ...
Daniel Jensen's user avatar
1 vote
1 answer
279 views

Build a query with JOIN, but filter and sort that joined table first

I'm building a custom component in Joomla 3.x. I have two tables in my model: table persons id name 1 Peter 2 Paul 3 Mary table cars id personid make price 1 1 BMW 10,...
michi's user avatar
  • 37
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 ...
Peli's user avatar
  • 103
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 '&...
cappu's user avatar
  • 139