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
1answer
47 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? ...
2
votes
1answer
34 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 (...
0
votes
0answers
20 views

1146 Error when creating custom table

I have created a secondary user table to store other information in the Joomla database. However, when I try to insert information into that table, I get this error. 1146 Table 'database.#__vvuser' ...
2
votes
2answers
39 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
1answer
29 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
1answer
80 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, ...
0
votes
1answer
29 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 (...
1
vote
0answers
28 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
1answer
35 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
1answer
28 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
1answer
43 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 ...
0
votes
1answer
24 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
3answers
100 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"=>"...
2
votes
2answers
45 views

Json encoding being escaped

I'm writing to the db (I'm automatically creating a module): $module = new stdClass(); $module->title = $moduleTitle; $module->note = ""; $module->content = ""; $module-&...
1
vote
1answer
99 views

Where to find article page title in database?

When managing an article, there is a "Browser Page Title" field in article options tab. It's the last field in the tab, just below the "Read More Text". Why it's not in the publishing tab makes no ...
0
votes
2answers
41 views

Does Joomla Host Value under Server Database setting needs a change after change in ip address

need help. My web hosting recently sent email that they will perform an infrastructure upgrade and migrate my Cloud account to a new server with the latest hardware in Google facility. They now ...
1
vote
1answer
141 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 ...
1
vote
0answers
107 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
2answers
87 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($...
2
votes
1answer
371 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
0answers
32 views

Display a form and post it to dabase

I want to insert a form in a default.php file and post it to the database. How should it be done? By adding an XML form or creating a regular HTML form and posting it to the database through a ...
1
vote
1answer
74 views

Error saving an edit in a custom component `table_users` was not locked with LOCK TABLES

I'm getting an error when trying to save edits in my custom component. I have another edit.php that works well. I identified that the problem lies in the table file, specifically in the function ...
0
votes
0answers
37 views

Retrieve all fields using while in Joomla

I'm trying to retrieve data using while and it won't work. The page just keeps loading and ends up with a blank page; no errors or anything but, when i use foreach, it works. Any explanation? The ...
2
votes
0answers
28 views

Very slow initialization of Joomla when on remote database

Running Joomla 3.9.15. When I am using a remote database (still on the same local network though), I am facing massive slow downs on the "before preloadComponents" phase of Joomla init. The actual ...
2
votes
2answers
98 views

Unable to update NULL via updateObject

We got 2 tables where one table is parent and another table as a child with primary and foreign key reference. Assume table1 is the parent and table2 is the child as below. table1: id <- ...
1
vote
1answer
89 views

How to update database module params

Could someone kindly help please? I'm creating a plugin and part of its job is to automatically add a 'Menu Class Suffix' to a chosen menu. I know it can be done manually from the advanced tab of ...
2
votes
1answer
117 views

Transfer Custom Code to Module / Plugin / Component

Joomla 3.9.12 I've been using Sourcerer in order to place custom code throughout my site, it's working well so far. I've created a custom html module, within this I have added PHP, JS, HTML and CSS. ...
2
votes
1answer
36 views

Tips On How To Optimise A Joomla Site

Joomla 3.9.12 What's the most effective way of optimising a Joomla website? I'm not sure if my site is particularly large, details below; Files / folders 28GB Database 314MiB When I take a backup ...
1
vote
1answer
25 views

Custom Field Tag Style List

Joomla 3.9.11 I have created an SQL custom field for my joomla contacts called location, this allows me to assign a location to my contacts. The SQL simply selects location_name from a custom db ...
2
votes
2answers
3k 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: ...
3
votes
1answer
129 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 ...
1
vote
3answers
1k 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
3answers
2k views

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

I've updated to Joomla 3.9.3 and now when I open the articles pages, I get this error: 500 Unknown column 'a.note' in 'field list' I've tried to fix the database with the Joomla repair function, ...
0
votes
1answer
31 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(); ?
0
votes
3answers
891 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 ...
2
votes
2answers
804 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
1answer
41 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 ...
2
votes
2answers
248 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 ...
3
votes
1answer
834 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-...
1
vote
2answers
25 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 ...
0
votes
1answer
124 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 ...
1
vote
1answer
130 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
1answer
612 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 ...
3
votes
2answers
2k 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 ...
1
vote
2answers
384 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 ...
2
votes
2answers
626 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 ...
1
vote
1answer
88 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 ...
1
vote
2answers
144 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
0answers
103 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 (...
1
vote
2answers
90 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. ...