Questions tagged [mysql]

MySQL is a database system used by many websites on the Internet. Joomla is based on PHP and MySQL.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

View only showing one row from sql result set

I am creating a component and trying to display a list within a model. The code I have shows the multiple arrays that should be on the list, but when I add echo inside the view table, I am only ...
0
votes
1answer
43 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 ...
5
votes
1answer
2k views

SQL Injections using Jfactory::getDBO and setQuery() with LIKE condition

$db = JFactory::getDBO(); $searchP = JRequest::getVar('key'); $sql = "SELECT name FROM people LIKE " . "'%" . $searchP . "%'"; $db->setQuery($sql); $fileR = $db->loadObjectList(); Will ...
0
votes
2answers
137 views

Custom Component - Copy / Archive record when values change

For a custom component, I want to incorporate a way of keeping track of changes made to records in specific tables. For example, when the mileage value of a car is changed, the record having the old ...
0
votes
2answers
89 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>...
1
vote
1answer
34 views

How to use Joomla's query building methods to generate a query containing joined subqueries?

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
1answer
31 views

Joomla 3.9 replace zero dates with null on save/checkin (mysql zero date deprecated)

So zero dates are deprecated in MySQL. J4 has replaced them with nulls.I am trying to update a J3 component to stop J setting zeros in the modified and checked_out_time fields. For modified I am using ...
1
vote
1answer
220 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
0answers
32 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=&...
0
votes
1answer
45 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
1answer
94 views

How can I get the names of the columns with their corresponding row values as a list to use in a field (select list) of a form in Joomla MySQL

My table '#__boats' is as follows: id category type AIG ALLIANZ LLOYDS 1 0 Motorboats 2 0 Sailingboats 3 0 Jet Ski ...
0
votes
2answers
51 views

Run model function in view file to insert default value into sql

I am new to Joomla and received a half-done component. It is a mostly database-dependent component. The component consists of a SQL file that inserts all the data and is able to display it. I am ...
1
vote
2answers
418 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 ...
0
votes
0answers
49 views

How to display external SQL table using Joomla?

I am looking for good free extensions I could use to display SQL tables on my website. I have tried a couple but, they either don't work or ask for indexing which my tables don't have. https://joodb....
0
votes
1answer
159 views

Convert from MySQL query using SUBSTRING_INDEX into Joomla API query?

I have a query which gets the information that I want using SUBSTRING_INDEX in MySQL. I am trying to convert this to use the Joomla query building syntax, but I am not sure how it should be formatted? ...
1
vote
2answers
64 views

How to use SQL statements not supported by JDatabaseQuery

Recently, I have needed to use some SQL statements that are not supported by the JDatabaseQuery class, specifically REPLACE INTO and INSERT IGNORE. The only way that I am able to get something to ...
1
vote
3answers
127 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, #...
3
votes
4answers
1k views

Multiple INSERTS in one query Joomla

How can I do multiple inserts like: $query = "INSERT INTO `table` (`fied1`, `field2`, `field3`) VALUES ('one', 'two', 'three'),('four', 'five', 'six'); INSERT INTO `table` (`fied1`, `field2`, `field3`...
1
vote
0answers
96 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 ...
3
votes
2answers
571 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.
1
vote
1answer
175 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 ...
2
votes
1answer
40 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 (...
1
vote
0answers
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 ...
0
votes
0answers
35 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' ...
0
votes
0answers
8 views

K2 can't search number from Database table Field

I can contact his to K2 but they can't help me to much... My problem Drop-down Selection of K2, I created them. 5 Years Old 6 Years Old 7 Years Old 8 Years Old 9 Years Old If I search "5 Ye",...
1
vote
2answers
103 views

How to show multidimensional data in my CanvasJS chart?

<?php $db->setQuery("SELECT MartabehName, COUNT(MartabehCode) FROM `#__dimteacher` GROUP BY MartabehName"); $countMartabehName = $db->loadObjectList(); foreach($countMartabehName ...
2
votes
1answer
155 views

How to add pagination in joomla custom php code?

Please help me to add pagination (getLimitBox) to my table result. I have for example 100 rows in my table and I want to show 10 page. <?php $formid=23; $db = JFactory::getDbo(); $query = $db->...
1
vote
0answers
32 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 ...
0
votes
1answer
36 views

How to conditionally add filters to my query of the rsform_submission_values table?

$FormId=23; $qustioan1=qka1; <form method="post" action="#"> <select name="state" onChange="irancitylist(this.value);"> <option ...
1
vote
1answer
80 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
1answer
51 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
2answers
271 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
100 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
81 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
1answer
159 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
2answers
94 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
1answer
420 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
30 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 ...
0
votes
2answers
69 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 ...
2
votes
1answer
60 views

How can I test Joomla performace

After searching a lot over the web, I found nothing about my issue. Its there any tool that can test my Joomla website/server performance?! I am searching for a tool that test the website how it will ...
2
votes
2answers
116 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 ...
1
vote
4answers
2k views

Insert query with ignore of duplicates (without key)

I have a query: $query_add_analogue ->insert($db->quoteName('#__parts_analogues')) ->columns($db->quoteName($columns)) ->values($value); $db->setQuery($query_add_analogue); $...
2
votes
1answer
57 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="...
2
votes
2answers
244 views

How can I translate SQL code into something that Joomla will take?

I am in the same case discussed on https://stackoverflow.com/questions/11709043/mysql-update-column-with-value-from-another-table, that is, I need to copy the value of a column from tableA to tableB ...
1
vote
1answer
42 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
1answer
57 views

Joomla / PHPMyAdmin bug when “select” is in the value

This question was originally asked on StackExchange, and it was recommended by @mickmackusa that I ask it here. Background We recently changed over from one server to a brand new one. Old server: ...
1
vote
2answers
2k views

MySQLi PHP Warning [closed]

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/...
0
votes
0answers
62 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 ...
1
vote
1answer
35 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
2 3 4 5