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
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
13 votes
2 answers
2k views

How can I programmatically get the Joomla database prefix using php?

I sometimes access the Joomla DB via external scripts. The problem I have is that if I ever need to change the prefix, I'll need to edit my scripts again too. Is there a way to programmatically ...
TryHarder's user avatar
  • 2,340
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
11 votes
2 answers
10k views

Catching exception/error in database transaction

I am using the following way in joomla 2.5 and 3 to execute database query - $database = JFactory::getDBO(); $database->setQuery $database->execute(); but how do I catch errors/exceptions if ...
dev-m's user avatar
  • 1,351
10 votes
1 answer
388 views

Migrate meta keywords to tags

Is there an easy way to migrate or copy existing meta keywords for articles so that they become article tags, in Joomla 3.6? The situation is: Joomla, until a few versions ago, didn't have a tag ...
uUnwY's user avatar
  • 203
9 votes
1 answer
2k views

Making Custom HTML User Profile Page by using Joomla Variables

I guess its going to be complicated but i will try my best to make you understand, what i want to achieve. All i want, is to make a custom HTML page, which will show the information of the user who ...
saibbyweb's user avatar
  • 2,289
7 votes
2 answers
528 views

Recommended practices regarding transfering database from Joomla 1.5 to Joomla 3

I want to transfer about 300 articles from a Joomla 1.5 website to a Joomla 3.3.1 website. I have access only to the Joomla 1.5 database but not to the backend (I have access to both for the joomla ...
MagTun's user avatar
  • 976
7 votes
2 answers
122 views

Options for backups, restoring, and staging?

What are some options for Backing Up & Restoring Joomla! instances? Preferably ones suitable for staging.
Nestor Ledon's user avatar
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
5 votes
1 answer
3k views

Query database for articles, filtering by tag

I can use this to get published articles from the database: function queryDatabase_Posts($select, $limit) { // Database connection and query object. $db = JFactory::getDbo(); $query = $db-...
kunterbunt's user avatar
5 votes
2 answers
979 views

JForm with custom SQL statements

I have a JForm, which inserts records in the database and relies on its own controller, model, view and table, derived by JTable. However, the database table contains one special field representing ...
Demis Palma ツ's user avatar
5 votes
2 answers
2k views

Joomla MVC Component File upload w/ Database field update

So I find this a little weird because the DB field was updating without much effort on my part, until I started writing in file upload functionality. Now the database doesn't seem to be updating, but ...
dustin's user avatar
  • 107
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 ...
El cero's user avatar
  • 221
4 votes
3 answers
4k views

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

With the existing output I have from a basic query, what would be the best way to get the names of the columns in the resultant output object without having to run an additional COLUMNS query on the ...
Merlin's user avatar
  • 203
4 votes
2 answers
432 views

Using Separate Databases for Each Component

My client is a Data Center Architect. Due to his experience with his work (many customers come to him because they have suffered great data loss in the past), he would like me to configure his ...
nico's user avatar
  • 155
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
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
4 votes
1 answer
1k views

Table marked as crashed and repair failed

My Joomla 1.5.16 website has started to display the error below. I don't think this is a hack, and I can't find any evidence in the logs of someone trying to get in or any changes to files that ...
toomanyairmiles's user avatar
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, ...
rancper's user avatar
  • 63
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
2 answers
3k views

Migrate users account from Joomla 3 to another Joomla 3 manually

I'm trying to migrate Joomla 3 user's information to another Joomla 3 installation. From PHPMyAdmin I exported _users table and _user_usergroup_map to the new Database. The users appear in the user ...
Víctor Cardozo's user avatar
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. ...
Dionysus's user avatar
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
4 votes
2 answers
3k views

Creating a module to search the database and display the results

I have got a table in the database called #__magazines, this holds data for magazines (date published, issue number etc..). I have created a Component, Plugin and Module which is for Joomla 3.x, I ...
RustyJoomla's user avatar
  • 2,078
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
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::...
RustyJoomla's user avatar
  • 2,078
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(...
user1616338's user avatar
3 votes
2 answers
669 views

Joomla Debug Console does not show Database Queries

My Joomla 3.4.4 website is not showing Database Queries in Joomla Debug Console at the site front-end but it can be seen at the Administrator back-end. Below is the screenshot at the front-end And ...
Aung Myo Linn's user avatar
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 ...
zexa's user avatar
  • 41
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
2 answers
489 views

A foreign key field not updating as NULL

I am having a field 'leavepack_id' in a table with the below table definition CREATE TABLE IF NOT EXISTS `#__position` ( `position_id` int(11) NOT NULL AUTO_INCREMENT, `leavepack_id` int(9) ...
Malaiselvan's user avatar
  • 2,731
3 votes
3 answers
1k views

Insert into database with ajax from a joomla 3 module

I have seen a lot of inquiries about ajax, but normally there are about retrieving data from database. I was wondering about how to insert data directly interacting inside a module. I have a module ...
WillyC's user avatar
  • 31
3 votes
1 answer
195 views

How to separate database results into 2 columns?

I saw the examples of how to do the odd even way, but I want the order to flow from one whole column to the next and not alternating left to right for each alphabetical item. Can this be done? Here ...
Mythic's user avatar
  • 165
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
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
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
3 votes
2 answers
553 views

How to prevent Joomla from reporting database error information

I'm currently investigating SQL injection attack vectors in my application. Currently, Joomla is reporting database error output when returning a HTTP 500 error page. How do I prevent this? The ...
John Rix's user avatar
  • 561
3 votes
2 answers
821 views

Joomla assets table ucm rows

Does anyone know what these rows are for? Is it safe to remove them? Since they seem to be mostly empty? Note: this is assets table!
user avatar
3 votes
2 answers
51 views

Clean up a WIP site before launch

I've been working on my own template for work, and in the progress made different temporary articles, categories and menu names. For the launch I'd like to clean it up as much as possible, resetting ...
Dsan's user avatar
  • 157
3 votes
2 answers
136 views

What is the proper use of the name tag in the manifest file?

In the latest J!3.4 when installing extension of type 'file' (or may be other types are affected also) there is a difference regarding what is going into element field of table _extensions. Some ...
Plamen's user avatar
  • 747
3 votes
1 answer
862 views

Installing PostgreSQL database - Error connecting to PGSQL database

I try to install Joomla 3.3.1 on a new site, with PostgreSQL database. I did all correctly, and I tried many times, did lot of verifications, etc, and I have always the return : "Impossible de ...
catherine's user avatar
3 votes
1 answer
452 views

Delete all demo data

Many templates come with demonstration data that may be installed to show off the features of a template. Is there a simple method of deleting all this data or am I going to be forced to delete each ...
Rafe's user avatar
  • 247
3 votes
1 answer
1k views

Date or DateTime in database for Component Development using timezones?

Our component manages Television programming, so dates & times are critical - here's the scenario: Our server and most producers are all on local, Pacific Time (America/Los_Angeles, UTC+8) Joomla ...
GDP's user avatar
  • 7,715
3 votes
1 answer
126 views

Using variables from a database like source

I have a google sheet (no, the data does not need to permanently reside there.) Which contains data for T-Shirts of my design Name Source Thumbnail Commision ...
Matt's user avatar
  • 481
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 ...
jonboy's user avatar
  • 3,613
3 votes
1 answer
31 views

Is there a way to purge all content and maintain settings?

I need to purge huge amount of data from J but maintain settings / modules etc. I've tried to write cli tool to clean up tables using correct models, but it is taking too much time. Is there a simple ...
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

1
2 3 4 5