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
3
votes
1answer
63 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 ...
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 ...
1
vote
2answers
2k views

How to fix Joomla site both frontend and backend shows error page (site down) after fix database?

I have Joomla 3.4.8 site (multilingual site) that shows this error on the front-end that said : **Fatal error:** Call to undefined method JLanguageMultilang::getSiteLangs() in **/mysite/public_html/...
1
vote
2answers
2k views

MySQLi PHP Warning

I am getting the following errors (in this order) thousands of times in my error log: [08-Jun-2016 13:11:05 America/Detroit] PHP Warning: mysqli::stat(): Couldn't fetch mysqli in {...}/libraries/...
10
votes
1answer
252 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 ...
1
vote
2answers
186 views

Update multiple columns with plus 1

I have a website for my footballteam. I have some statistics and so on in there, fx how many games each player has played and so on. What I would like, is for me to write in the names of every player ...
2
votes
1answer
73 views

Database errors after moving remote db to localhost

I've recently run into a strange issue after upgrading to 3.6.5. I've been trying to resolve issues with a failed one-click-update to my live site. Thankfully, I had a pre-updated backup living on a ...
1
vote
3answers
165 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 ...
1
vote
1answer
52 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
1answer
310 views

Joomla 3.9.3 Articles: 500 Unknown column 'a.note' in 'field list'

I've updated to Joomla 3.9.3 and now I get this error 500 Unknown column 'a.note' in 'field list', by opening the articles pages. I've tried to fix the database with the repair function, but this ...
2
votes
2answers
1k views

Preprocessing form data before saving to the database

I have a series of checkboxes on my form that together form an array when POST'ed. I want to save this data as a string instead (e.g., "##,##,##") before committing to the database. Here's what I ...
0
votes
0answers
14 views

idx_XXX error after reimport from content table

I export only the xxx_content table from SQL with TRUNCATE. After reimport the table the follow error message comes: ALTER TABLE `XXX_content` ADD PRIMARY KEY (`id`), ADD KEY `idx_access` (`access`...
2
votes
2answers
964 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 ...
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 ...
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 ...
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
1answer
866 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 ...
0
votes
1answer
24 views

Connect to two MySQL db's [duplicate]

I want to use a second database for the product data. Is it possible to connect to two database and using of JFactory::getDbo(); ?
2
votes
1answer
401 views

Select data from multiple tables and output results as json [closed]

I wrote this query for getting data from 3 different tables which has one similar column. The trouble is, it throws an error: 500 internal server error I need the output to be in the form of json,...
1
vote
3answers
898 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 ...
3
votes
2answers
358 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 ...
12
votes
6answers
17k 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 ...
0
votes
1answer
74 views

Can't login to Joomla! admin updating password in PHP MyAdmin doesn't work

I cannot log into the Joomla! admin. Updating the password in PHP My Admin does not work. It always says that my username and password do not match, the user does not exist or I have not been ...
0
votes
3answers
205 views

Can Joomla! read from a CSV file?

I'm building a Joomla! Website (currently running 3.9.0). It's a website of a Sports Club and we would like to add Live Score, Scoreboard and Last Result. The Sport Association told us the only two ...
1
vote
2answers
210 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(...
2
votes
2answers
114 views

How to query certain rows from a table based on other associated rows in the same table?

I'm trying to query my jos_rsform_submission_values table for FieldValue data in rows with a FieldName of Container# which shares a SubmissionId with another row where the FieldValue is "Pending" and ...
1
vote
1answer
26 views

Joomla table DESCRIBE

I'm trying to DESCRIBE a table in joomla 3.x I want to get the column names and the associated details (type etc) into an array. I want to get Name Type Collation Attributes Null ...
3
votes
1answer
194 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-...
2
votes
2answers
228 views

Custom Component load data

I'm fairly new to Joomla and I'm taking over a project from a previous developer. In a custom component we are capturing user data in a form. Before the name and address is entered into the database ...
1
vote
2answers
97 views

Localize output of SQL query

I make a query directly on the database like this: SELECT title,id, DATE_FORMAT(publish_up, "%d %M %Y") AS 'GEORGE' FROM #__k2_items WHERE published=1 AND trash=0 AND created_by=[id] ORDER BY ...
0
votes
3answers
486 views

Count rows from multiple database tables

On a project of mine, I've recently moved from native PDO to the Joomla Database Framework package. Before, I prepared the following statement to count the number of rows from multiple tables (...
1
vote
2answers
21 views

User Showing in User Manager but not Data base

Problem, users are showing in User MGR and they can login, but the users are not showing in the data base. I've created new database and reinstalled same issue, Tried creating a test user with the ...
1
vote
2answers
53 views

Variables do not work in email form

I made a simple email form to send an attachment (image). All sender information is taken from the joomla database, the user selects from the dropdown list (populated from database) new name of image. ...
1
vote
1answer
88 views

Why does the truncateTable() method create an empty string for a query and fail to delete rows?

I have the following code attempting to truncate a table. The Joomla documentation makes me believe this will work, but it does not. What am I missing? $db = JFactory::getDbo(); truncate_query = $db-&...
2
votes
2answers
387 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 ...
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 ...
2
votes
1answer
403 views

Convert line breaks in php textarea

I have a kind of a guestbook on my page. It's just a common textarea like this: echo ' <textarea name="msg"></textarea>'; and then I use a form to send me to the backend on submit: $db =...
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 ...
4
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 ...
2
votes
2answers
241 views

Trouble Connecting to External Database

Context: Joomla 3.8.5 MySQL Joomla database = berrien_dev External database = BMP PHP 5.6.33 I am attempting to access in a component I am writing an external database that sits in the same MySQL ...
3
votes
2answers
712 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 ...
0
votes
0answers
64 views

Custom Joomla plugin to catch specific database queries

Is it possible to make a plugin which will get triggered by specific database events in Joomla? I need to watch the $this->getTable() request in Joomla. For eg: $table = $this->getTable(); if (...
2
votes
1answer
752 views

Access external database connection in function?

I have the following code in an article using Sourcerer and it works fine but I would like to move the connection section out of the function so that I only need to create it once for multiple ...
1
vote
1answer
327 views

Migration from MySQL to MSSQL database

I've a Joomla 3.6 project which is built on mysql db. I want to know how can I migrate to mssql db? Maybe someone could do step by step guide and suggest some tool for migration?
1
vote
5answers
2k views

Are there any alternatives to Fabrik for building a database application (ERM/CRM)?

I am building an internal database application for Joomla using Fabrik. I'm interested to know if there are any alternatives to Fabrik for me to use. Maybe some of them have more options? In my case, ...
0
votes
1answer
99 views

Error on upgrade of database

I manually upgraded a Joomla 3.3 to 3.4.8, but Extensions > Manage > Database showed: The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4). I clicked ...
2
votes
1answer
33 views

How to edit the text string “Contact Form”

How to edit the text string "Contact Form". Client wants it to say Inquiries. People are using it to make booking which he would like to avoid. Thanks. http://chrisgarsidepodiatry.com.au/index.php/...
2
votes
4answers
2k 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
6answers
250 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
619 views

I am trying to connect two database with one Joomla site

I have two joomla site with different database.And I want to share all data one site to Another site .For example when I register A user in one website then it's updated on second site database also....