Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

31
votes
4answers
4k 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 ...
13
votes
2answers
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 ...
12
votes
6answers
16k 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 ...
11
votes
1answer
10k 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 ...
11
votes
2answers
8k 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 ...
10
votes
1answer
249 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 ...
9
votes
1answer
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 ...
7
votes
2answers
508 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 ...
7
votes
2answers
104 views

Options for backups, restoring, and staging?

What are some options for Backing Up & Restoring Joomla! instances? Preferably ones suitable for staging.
6
votes
1answer
668 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 ...
5
votes
2answers
4k 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 ...
5
votes
2answers
2k 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 ...
5
votes
1answer
2k 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-...
5
votes
2answers
908 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 ...
5
votes
1answer
588 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 ...
5
votes
2answers
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 ...
4
votes
2answers
400 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 ...
4
votes
5answers
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 ...
4
votes
3answers
3k 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 ...
4
votes
1answer
851 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 ...
4
votes
2answers
343 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 ...
4
votes
1answer
266 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 ...
3
votes
2answers
896 views

Adding Multiple Users in Joomla

How can to add multiple users in Joomla 3 without using an extension? Thank you! :)
3
votes
2answers
391 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 ...
3
votes
1answer
683 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 ...
3
votes
2answers
307 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|bryan@hotmail.com | I have a frontend where users can sign up and then I have this for ...
3
votes
1answer
91 views

Extension to edit multiple articles in a same pattern?

I am trying to fix an old joomla site so it can be responsive. In the articles, every image comes with style="width:1150px;height:650px", I need to replace all these occurrences with style="width:100%...
3
votes
2answers
379 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) ...
3
votes
3answers
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 ...
3
votes
1answer
658 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?
3
votes
2answers
505 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!
3
votes
2answers
49 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 ...
3
votes
2answers
933 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/...
3
votes
2answers
697 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 ...
3
votes
2answers
94 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 ...
3
votes
2answers
2k 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 ...
3
votes
1answer
689 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 ...
3
votes
1answer
147 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-...
3
votes
1answer
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 ...
3
votes
1answer
103 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 ...
3
votes
1answer
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 ...
2
votes
2answers
2k 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" ...
2
votes
6answers
243 views

Database Error At Busy Times

My Joomla 3.6 website up time is pretty good, however at times of high traffic, my site shows a white page with the following text; Error displaying the error page: Application Instantiation Error: ...
2
votes
2answers
724 views

Change “Show page heading” param for every menu item

I've got a site with few hundreds menu items. I need to change one parameter in all of them. Right now in most of the pages "Show page heading" paremeter is set to "No". I need it to be set to "Use ...
2
votes
2answers
135 views

Transfer Joomla data from PHPMyAdmin SQL Dump

My friend's web page was created with Joomla (c. 2013), and she wants to transfer her site to a new host. Her current host sent her a SQL Dump generated by PHPMyAdmin, which contains what I assume is ...
2
votes
2answers
71 views

Not well written script cause high resource consumption

Recently a server's admin sent a report about a Joomla site that is causing too much resource consumption. The report said : CAUSE OF HIGH RESOURCE CONSUMPTION: We have conducted a detailed ...
2
votes
4answers
619 views

Configuring a Joomla website using wamp on multiple computers

I am working with Joomla for the first time and I am having trouble configuring it. From the articles available from the internet, I followed the following steps to clone a Joomla website to various ...
2
votes
4answers
1k views

How to retrieve data from the Joomla DB via jQuery.ajax without controller

I need to retrieve some data from #__virtuemart_order_histories in templates/active_tmpl/html/com_virtuemart/orders/details_history.php via jQuery.ajax. I know that I can do it with a new &task= ...
2
votes
1answer
211 views

How to transfer user data from a VM1 to a VM3 website?

I am going to replace a VM1 website with a VM3 one. They have over 1500 users, so it would be very good to transfer them over to the newer site rather than making them all sign up again. Is it a case ...
2
votes
2answers
941 views

Joomla 2.5, how to use “HAVING” using Query Object

"SELECT *, ((ACOS(SIN($lat * PI() / 180) * SIN(latitude * PI() / 180) + COS(78 * PI() / 180) * COS(latitude * PI() / 180) * COS((87 - longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance ...