Questions tagged [mysql]
MySQL is a database system used by many websites on the Internet. Joomla is based on PHP and MySQL.
286
questions
1
vote
1
answer
96
views
Nooku Request Problem
I am using Nooku framework and Joomla CMS and MySQL database to create an application , and I need to retrieve a certain data from another table into the dropdownmenu of my table , using Nooku ...
1
vote
2
answers
143
views
How to refactor my iterated sequence of queries?
I'm building a component which is about to be finalized, but there is a bit of code that I want to refactor. I think this code can be completed in one statement and I used more than 3 statements.
$db ...
1
vote
1
answer
75
views
Show Subsribed Kunena Threads based on logged in User ID
I am trying to show all subscribed Kunena threads based on the current logged in user.
Kunena stores the subscribed threads in the '#__kunena_user_topics' table, I've written the following but it's ...
1
vote
1
answer
416
views
Modified database layer to use Amazon RDS's read replicas and master in MySQL
I've been searching without success a plugin that might split Joomla's read queries to one endpoint and write queries to another endpoint. This would enable us to use Amazon RDS's read replicas (MySQL)...
1
vote
1
answer
503
views
How can i get a categories tree view in alphabetical order without to lose the tree structure
I use for my component a categories table like the categories table from Joomla.
So the structure has also the columns from the Joomla categories table:
- Table jos_my_categories structure: id, ...
1
vote
1
answer
1k
views
I can load data from Joomla database and external database?
It is possible to join 2 databases at the same time in a single query?
For example: I want to see how many users I have on my server and how many users I have on an external server, all in a single ...
1
vote
1
answer
72
views
How can I modify/control the HTML output of my Module?
I'm developing a Joomla 3.x.x module which connects through to a components table in the database.
I have got the following code in the helper.php which outputs the variables successfully:
public ...
1
vote
1
answer
72
views
MySql User with Multiple DBs Advice
I have recently created a Joomla 3.3 website which consists of one user (all privileges) and one database on my shared hosting account.
I'd now like to install Piwik analytics aswell on the same ...
1
vote
1
answer
177
views
Standalone PHP script to get username in Joomla 4?
In Joomla 3 I used the following code. What do I need to change to use it with Joomla 4?
<?php
define( 'DS', DIRECTORY_SEPARATOR );
$rootFolder = explode(DS,dirname(__FILE__));
//current level ...
1
vote
1
answer
66
views
Mysqli query with regex to Joomla php syntax
// CODE1 (Mysql (MariaDB 10.8.3) query):
SELECT s.`p_p`, COUNT(REGEXP_SUBSTR(r.`xml`, '[0-9]+'))
FROM `#__s` AS s, `#__p` AS x, `#__v` AS r
WHERE REGEXP_SUBSTR(r.`xml`, '[0-9]+') = [user_id] AND s.`...
1
vote
1
answer
322
views
Joomla 4 - 503 service unavailable
I've set
public $error_reporting = 'maximum';
public $debug = '1';
If I go into cPanel and turn off mysqlnd nd_mysqli and nd_pdo_mysql and then turn on mysqli I get an error
MySQL server has gone ...
1
vote
1
answer
397
views
How to use Joomla for insert, delete, display and update data from mysql?
I'm just started to learn using Joomla and one of the things that I need to do is to build a form that can insert data and that data can be displayed to another Joomla page.
I got a few comments from ...
1
vote
1
answer
75
views
Joomla mysql query - group_contact
I have mysql query:
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$formId = 21;
$query = "select * from #...
1
vote
1
answer
63
views
PieChart For RSForm for PlotaLot based on a dropdown field
So I got this Pie Chart to display the Count of Voters vs Position and it's working fine.
SELECT Position,
COUNT(1) AS count
FROM (
SELECT
MAX(IF(FieldName = 'Position', FieldValue, NULL)) ...
1
vote
3
answers
354
views
Join #__content with #__fields_values then filter and sort using #__fields_values data
I wrote an override in Joomla 3.X and sorted the result from the DB using this query, which works:
$query = "SELECT content.*, fieldvalues.*
FROM #__content AS content,
#...
1
vote
1
answer
158
views
RSFORM combine 2 submission form results in one Plotalot view
After requesting help from local db-masters with no result, I would like to ask this question here. The output required is this for example:
Shelter ClientID Year Month Fees Amount ...
1
vote
1
answer
118
views
JFactory query to select field value if mulitple conditions are met
I'm basically trying to create a Joomla JFactory query to COUNT and SELECT data if a particular field's value meets my criteria.
In "myTable", I may have several records where Field4 may ...
1
vote
2
answers
492
views
Selecting data from two tables and make a ranking in an HTML table
I want take the result from scheda_atleta table for every player and make an HTML table with the best result. I've two tables:
first named: at
+----+----------------+
| id | nome_e_cognome |
+----+----...
1
vote
1
answer
242
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
1
answer
88
views
Problem accessing database from front end of a component
I am currently working on a component which will display "events", stored in a database, on a map (filterable by location, category, date etc...). My first step is to display a simple report of the ...
1
vote
1
answer
55
views
How to match database values regardless of accents on letters?
With the following LIKE condition in my WHERE clause, I only get the exact match.
. ' LIKE '. $db->quote($db->escape($artist)), 'AND') .
When $artist is, for example Beyoncé, it only returns a ...
1
vote
1
answer
63
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 ...
1
vote
1
answer
511
views
How to query for users from a specific user group?
I want to list only the users with a group_id value of 10.
Why doesn't the following query work?
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('a.id, a.name, a....
1
vote
1
answer
327
views
Delete query and left join with JDatabaseQuery doesn't work
I'm trying to convert a delete query with left join to use JDatabaseQuery, but I am encountering an issue in the query. The query that I'm trying to convert and which works is the following :
$db->...
1
vote
2
answers
215
views
Filtering product query with two sets of filters. (J2Store)
I have two disjointed sets of product filters, $special_filters and $other_filters. I'm trying to retrieve the products from the database which match any of the filters in $special_filters AND any of ...
1
vote
1
answer
75
views
How to integrate my custom Administrator component with core Joomla database tables during install?
Background: I am starting to package up three associated custom Joomla extensions that I've developed. (This is directly associated with my previous JSE question, if you want more context.) The ...
1
vote
1
answer
286
views
SQL Error when updating custom component in Joomla 3.9
I have a custom component and I want to add language filter to my extension.
So in my sql update file I added the following two lines to Alter my tables.
ALTER TABLE `#__contract_contracts` ADD `...
1
vote
1
answer
218
views
How to construct a JOIN query with Joomla's query methods?
I'm really new to SQL queries but now stuck with this one.
I need the first and last name of a user
from table #__comprofiler
where their cb_job_role = 'Team Leader' and their cb_service_name = [the ...
1
vote
2
answers
1k
views
Use one pdo connection across multiple modules?
I have multiple modules on the same page that are individually connecting to the same external database through pdo connections. The website is getting slower since I added more modules. My guess is ...
1
vote
1
answer
101
views
Query gives a single value when two columns in SELECT clause
I do have a database connection earlier in the script.
$db = JFactory::getDbo();
Here's the query code:
$albumartistidquery = $db->getQuery(true);
$albumartistidquery->select($db->...
1
vote
1
answer
378
views
How to debug a 500 can't load error?
I have moved a website running joomla from my old VPS to my own server. The server is working fine, other sites are loading. However, this joomla site doesn't load.
Please can someone explain what ...
1
vote
1
answer
325
views
Retrieve article URL from phpMyAdmin
I am migrating a site from Joomla to WordPress. The migration tool didn't setup redirects for the old urls so I'm planning to write something to do them for me. I need a way to output all the current ...
1
vote
2
answers
470
views
Select+Checkboxes fields = query a Database [closed]
I want to make a form which contains one select field (dates) and multiple checkbox fields (teams), so when I select a date or choose a team, automatically makes a query a database, filtering by the ...
1
vote
1
answer
65
views
Mysql Error 1273 when moving DB from dev to live server
So, I recently updated to version 3.6.5. I initially tested the update on a test server before moving the update to my live server. The issue I'm running into is Mysql 1273
Error
CREATE TABLE `...
1
vote
1
answer
483
views
How to add column if not exists when installing a component?
I would like to know when installing a component over an existing one, if it's possible to add a new column if it doesn't exist.
For e.g. inside install.mysql.utf8.sql, I shall have something like:
...
1
vote
1
answer
244
views
Delete users from Joomla V2.5
I am having an outside contractor work on my joomla site, and want to protect the users and passwords. I cannot use the solution in this thread since I have too many users - Bulk user delete on joomla ...
1
vote
1
answer
163
views
SQL Query Problem in Joomla 3.x
I'm quite new to SQL and PHP and tried two write an array into the database, but I couldn't figure it out so far I always get following Error:
1054 Unknown column 'Array' in 'field list' SQL=...
1
vote
1
answer
131
views
Joomla 2.5 and Virtuemart 3 installation problems
I've tried installing Joomla 2.5 and Virtuemart 3 (full install download from Virtuemart's website) and I went through the installation process ok. However I've had a lot of errors come up and don't ...
1
vote
1
answer
177
views
Joomla 3.x Access Control / user role [closed]
I'm using Fabrik 3.2 Form builder to build a shipment tracking system (like DHL) using Joomla 3.x. I have built the form & added some records. Now what I want is when a customer logs in using the ...
1
vote
1
answer
1k
views
Submit external data to RSForms MySQL table
I have a form on a non-Joomla website which has the following fields:
Full Name
Email Address
Work In A Pub (Tick box)
Supplier (Tick box)
Over 18
I have the following code to send from the external ...
1
vote
1
answer
986
views
Database error, do i need to worry about it?
I am getting this error in my error_log file. Do I need to worry about it? Although, I am having broken image link problems and SEF problems on some pages.
[06-Sep-2014 20:55:05 UTC] PHP Warning: ...
1
vote
1
answer
214
views
Joomla 4.3.1 Web installer fails to find MariaDB (MySQL) or PostGreSQL 11
I am trying to install Joomla 4.3.1 on my Ubuntu 18.04 machine. I am running Apache 2.4.57, PHP 7.4 (for Apache, apparently), PHP 8.2 is also installed, and two installations of PostGreSQL: 10.4 (...
1
vote
0
answers
54
views
workable php 7.4 function in joomla 3.10 is working weird in php 8.0
Am displaying list of news haviing
Date
News Heading
Short Descrption
The list is spread to around 100 pages, having 20 news in each page
Issue is: This is working absolute fine in php 7.4.x in ...
1
vote
1
answer
114
views
GROUP BY and ORDER BY from different tables of CB extension as outcome to a list
I am trying to figure out how to implement this.
Table1 with subscriptions AS sub
id, status, user_id, plan_id, parent_plan, parent_subscription
Table5 users (Joomla) AS u
id
Table6 fields AS ue
...
1
vote
0
answers
48
views
Using sql field in custom component
I have a custom component, it allows admins to select a related content article from the #__content table using the following:
<field name="relatedcontent" type="sql" default=&...
1
vote
0
answers
26
views
MySQL - Is a query with many results or several queries with one result more efficient? [duplicate]
I need to get category titles for which I am using the a model where $result returns all the data from the categories table, what I need is only the titles, that by making a loop to $result and a ...
1
vote
1
answer
92
views
How to use Joomla's query building methods to generate a query containing joined subqueries? [closed]
I am trying to write a query using Joomla's query building methods, but I cannot manage to write the subquery into the query.
Here is my desired raw sql with php variables:
"SELECT track_type,
...
1
vote
0
answers
42
views
Want to dynamically create users via database, how do I encrypt password?
I'm handling two websites a main one with a huge database and a secondary one, I want that when a user is created in the main one that it also creates it for the secondary one, I already connected the ...
1
vote
0
answers
295
views
How to count total queries with limit for pagination in Joomla getDbo
I am trying to build an author page with the lists of your articles in com_contact (this option exists but it cannot paginate). I need it to be paginated. So I am creating arbitrarily without ...
1
vote
2
answers
93
views
Trying to display mysql values properly in php
I am trying to display my commissions for each month. I want to display all 12 months with a total for each month. I've started with just January but this is as close as I have come to get to what I ...