Questions tagged [mysql]
MySQL is a database system used by many websites on the Internet. Joomla is based on PHP and MySQL.
233
questions
1
vote
1answer
61 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 ...
0
votes
1answer
40 views
Logged in users not logged into Kunena on second site
I have 2 sites, let's call them site1 and site2. They're setup as subdomains such as:
site1.domain.com and site2.domain.com
They're both running Joomla 3.9.24 and I have created a view on site2 ...
1
vote
0answers
11 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
1answer
38 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 ...
0
votes
1answer
39 views
Joomla Dev site accepting only prod credentials and directing to Prod site after replicating the Prod db dump to Dev DB
I have exported the Joomla DB dump from Production application and imported the same production sql dump file to my development environment. Now when i launch the development site then it logs me in ...
1
vote
2answers
229 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
1answer
42 views
loadAssocList() is not working properly when assigning a column name as the key parameter
I have a complex query like below. I want the p.ComponentId values to be the first level keys of the multidimensional result set array. However, it does not work as expected. In my case, when I don't ...
1
vote
1answer
27 views
Mysqli using AS clause not working
I have two tables that are joined. Both have an id column.
$query
->select($db->quoteName(array(
'a.id',
'a.address_one',
'a.address_three',
'a.address_two',
'b.id AS myStuff',
'b.person_id'
'b....
2
votes
1answer
70 views
PlotALOT RSForm Query showing only one result
After being helped very well by Stack community and learning a bit I created a query to show the sum of payments per client. A client can pay multiple times. I would like to know the sum of payments ...
1
vote
2answers
49 views
Deleting rows in two different tables
I'm trying to make function (task) and deleting rows in two tables. But I don't get this sql query working, I only got this error:
1064 - An error has occurred.
You have an error in your SQL syntax; ...
2
votes
2answers
60 views
How to apply aliases in SELECT clause when two columns from JOINed tables have the same name?
I am trying to build a gamelist, right now I'm struggling getting the detailed team information.
#__game
id team_home team_guest
1 1 2
2 2 3
#__team
id ...
0
votes
2answers
66 views
Removing links from articles in Joomla using MySQL query
Trying to use ChristoKiwi's https://stackoverflow.com/questions/19356897/removing-links-from-posts-in-wordpress-using-query/61652078#61652078 approach for deleting links in Joomla articles, but having ...
1
vote
1answer
116 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 ...
2
votes
1answer
54 views
Show article details from custom module
I am trying to develop a custom module where I have options to select 4 different Joomla articles.
In my module XML file, I have the following:
<field name="articleOne"
type="sql"
label="...
1
vote
1answer
257 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 ...
1
vote
1answer
40 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 ...
0
votes
0answers
61 views
Code works properly but shows data for all users
I am using the latest RS Form Pro with Joomla 3.9, Platform 13.1.0.
My code is working properly (thank you guys!) But the data should be limited to each user. The user ID is is not in the table ...
2
votes
1answer
33 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 ...
2
votes
2answers
48 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 ...
1
vote
2answers
67 views
Jooma Article content to load from mysql based on ID in url?
On my old website, built in php i had a link on a page, wich picked an ID based on what line it was.
<td width=124><a href="tp/package.php?ID=<?php echo $row[0];?>">Package</a>...
0
votes
0answers
204 views
Joomla 3.9.13 - Error: Failed to start application
I just installed version 3.9 joomla in local using xampp. Once the installation was finished correctly I tried to navigate the site and the backend. After loading a few pages, this annoying error ...
1
vote
1answer
75 views
How to collect multi-row data from #__fields_values and assign specific aliases for each value in the result set?
I have the following (working) query to get name, username and the value of a custom field:
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(...
0
votes
1answer
50 views
Joomla 3 database query select with limit [duplicate]
How can I use this query with joomla 3 with limit to 3
SELECT * , (3956 * 2 * ASIN(SQRT( POWER(SIN(( $coorlat - latitude) * pi()/180 / 2), 2) +COS( $coorlat * pi()/180) * COS(latitude * pi()/180) * ...
1
vote
1answer
22 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
1answer
74 views
Raw sql query returns multiple rows, but with Joomla methods only one row is returned
For some reason the query I put directly to DB works, but when set in Joomla syntax it is returning only 1 result, and there should be a lot more...
Clear Mysql query:
SELECT
vmp....
1
vote
1answer
112 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....
0
votes
0answers
34 views
Joomla! extensions table is not unique
The Joomla! extensions table is not editable in PHPMyAdmin. I believe there are non-unique values there too, so it cannot have an index. This is wreaking havoc with my install, I can't add any new ...
1
vote
1answer
184 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->...
0
votes
1answer
63 views
How to write a DELETE query with WHERE conditions using JDatabaseQuery syntax?
I have a query which I am trying to convert to JDatabaseQuery syntax, but I'm not able to find the correct way.
The query is the following:
DELETE upt FROM #__mycomponent_user_posts AS upt WHERE upt....
1
vote
1answer
40 views
JCE convert unicode after save in my DB
I added 🔒 in the source code of JCE. JCE convert it to 🔒.
The problem is after save in my database ist is a scratch characters 🔒.
My question now is should I modyfy JCE (How?) or ...
1
vote
2answers
105 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 ...
3
votes
1answer
105 views
Issues to be aware of when calling `concatenate()`, `regexp()`, `rand()`, and `castAsChar()` in sql queries
I'm taking it upon myself to become aware of some of the lesser known/used query methods because I like toying with MySQL and I want to implement Joomla calls when possible/sensible -- because they ...
1
vote
1answer
60 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
1answer
591 views
Installation page not shown due to MySql access denied and 500 server error
On Ubuntu 18.04.1 LTS, the installation page is not shown. Instead, I see a blank page with
Error
On MySql log I see this:
Access denied for user ''@'localhost' (using password: NO)
However I ...
1
vote
1answer
124 views
How to write the logged in user id in Plotalot queries?
I am trying to use plotalot to graph user results. The program only uses mysql queries to pull data. How can I pull session specific user data with a mysql query? Normal Joomla session variables ...
1
vote
1answer
150 views
How to sort title of items with natural sort order?
When you have in a column a list of items such as:
Title1
Title2
...
Title10
Title11
and you filter on Title (alphabetically), the output is like:
Title1
Title10
Title11
Title2
I want it to sort ...
1
vote
2answers
399 views
How to get Custom Fields related to Joomla Content?
I want to know how they get the values of custom user fields within Joomla articles. This is to contribute ideas and ways to solve it.
2
votes
2answers
150 views
How to query for users that have all tags when searching for multiple tags?
I have this custom module that shows all contacts based on some tags. I can add one or more tags in a field in the module
What I want is to add the option in the module to show:
all contacts that ...
1
vote
1answer
189 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 `...
0
votes
1answer
1k views
MySQL update select one table from another
I'm struggling to get this MySQL query to work and hoping someone out there can help please.
I wish to "copy" one record from table traincomprofiler to course_dates where both tables share the column ...
3
votes
1answer
1k views
How to write a query with GROUP BY and ORDER BY using Joomla's query methods?
I have the following query that I need to convert to Joomla using JDatabase. This query executes as intended in the phpMyAdmin.
SELECT `id`, DATE_FORMAT(`estEventDate`, '%b %Y') AS estDate, COUNT(`id`...
1
vote
1answer
156 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 ...
2
votes
2answers
717 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
228 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
votes
1answer
291 views
How to write a conditional check on a column value with a mysql query?
I am trying to setup a simple default statement on the results page of a testing system. This seems like it would be relatively simple, but I cannot get my if statement to process properly.
The ...
2
votes
1answer
305 views
How to count the rows in a database table that have a date in the current year?
I am writing a module that displays a count of the number of records depending on the date_time column. I am able to get the result that I am looking for when using a static date as below. However, I ...
1
vote
2answers
807 views
How to write a query with a WHERE clause with two conditions?
I cannot seem to get this select statement to work with the WHERE conditions. Depending how it loads the data, I either get the first test result or all of the test results and not the user_id-...
2
votes
3answers
76 views
Confusion about using two select() method calls in one query
I am using Joomla's JDatabaseQuery methods to select some columns from two joined tables, but I don't understand something about the following snippet.
//Initialize variables.
$db = JFactory::getDbo()...
3
votes
1answer
682 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
1answer
124 views
How do I set the flag CLIENT_MULTI_STATEMENTS for calling multiple stored procedures in a single stored procedure?
How do I set the flag CLIENT_MULTI_STATEMENTS for calling multiple stored procedures in a single stored procedure?
I have 30 stored procedures I would like to execute with a button click to process ...