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
3
votes
4answers
606 views

How to only transfer new column values from one table to another?

I'm attempting to create a new table: _clients that will be simply populated with, for now, with the user_id column from #__user_usergroup_map. Ideally, the below code should pull all id's from #...
3
votes
1answer
423 views

COUNT(*) function not working in SELECT query

I wrote a simple SQL statement that counts the number of category IDs in a table. Problem is, its returning NULL. $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($db->...
3
votes
1answer
111 views

Using variables from a database like source

I have a google sheet (no, the data does not need to permanently reside there.) Which contains data for T-Shirts of my design Name Source Thumbnail Commision ...
3
votes
1answer
1k views

Deadlock on the sessions table

Infrequently, instead of my site loading I get a white screen of death with this error message: Deadlock found when trying to get lock; try restarting transaction SQL=INSERT INTO jom_session (...
3
votes
1answer
31 views

Is there a way to purge all content and maintain settings?

I need to purge huge amount of data from J but maintain settings / modules etc. I've tried to write cli tool to clean up tables using correct models, but it is taking too much time. Is there a simple ...
2
votes
2answers
805 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
161 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 ...
2
votes
1answer
208 views

Component SQL Updates Not Running

I have been troubleshooting this all morning and am stuck. Hoping someone can help. Using Joomla! 3.7.0. I have a component that contains a number of MySQL update files. These files have been working ...
2
votes
1answer
161 views

The safety of direct SQL-requests in Joomla templates/views

I need to change the ordering of which the products are displayed on the Virtuemart category page. The files models/product.php and tables/products.php are too complicated for me to put the changes in ...
2
votes
1answer
70 views

Will changing Article Category in Bulk with MySQL affect the integrity of assets table?

I need to change the category of around 100 articles from CatA with id 1 to CatB with id 2. Both categories are created and there are 100 Menu Items that point to the Articles currently in Category A. ...
2
votes
4answers
781 views

Configuring a Joomla website using wamp on multiple computers

I am working with Joomla for the first time and I am having trouble configuring it. From the articles available from the internet, I followed the following steps to clone a Joomla website to various ...
2
votes
3answers
282 views

Joomla 3.3.6 Union SQL Issue

I am having trouble using the union functions in Joomla. This is the SQL I need: SELECT * FROM (SELECT o.title AS org_name, u1.name AS username, 'president' AS `type` FROM ...
2
votes
2answers
1k 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 ...
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 (...
2
votes
1answer
120 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->...
2
votes
2answers
90 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 ...
2
votes
2answers
249 views

How to refactor two select queries on RSForm submission data?

I was wondering if anyone could help me JOIN multiple queries into one query. Currently, these 2 blocks of code retrieve information from the DB. I am using the "Sourcerer" plugin to add custom PHP ...
2
votes
2answers
377 views

How to retrieve RSForm submission data grouped by SubmissionId?

I have a table with 3 columns: SubmissionId, FieldName and FieldValue. 1) SubmissionId keeps ID submission. 2) FieldName stores field name of a form. 3) FieldValue stores field value of form field. ...
2
votes
2answers
371 views

How to combine several sets of 'ANDs' and 'ORs' in a complex WHERE query object?

I want to create a complex WHERE query that checks: If (condition1 = TRUE) AND (condition2 = TRUE) AND (condition3 = TRUE OR condition4 = TRUE) So the first two conditions MUST always be true and ...
2
votes
3answers
634 views

Can some form extension write to/populate with values from database?

I want to have a very basic form, basically just a couple text fields and a few checkboxes. Ideally this form would be able to save to a table somewhere with the userid/name of the user that filled ...
2
votes
1answer
260 views

phpmyadmin: how to save changes made on multiple rows using “edit”

Using an "find and replace" chrome's app, I made some changes in the fulltext field of 300 joomla articles. I could save each row one by one using the "go" button under each row (cf picture) but is ...
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 ...
2
votes
2answers
81 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
376 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 ...
2
votes
2answers
250 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 ...
2
votes
3answers
81 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()...
2
votes
1answer
532 views

Accessing current users custom field

I´ve added a custom users field (called "test"). Now I want to call the value of this custom field for the current user who is logged in. In the mysql databse I see the custom field under _fields. So ...
2
votes
1answer
654 views

Correct ways to verify update query is successful under conditions

I was trying to find out correct ways to verify db update query is successful but some problems i am fetching. Even if update query($db->execute()) is not done/row does not exists.... but it ...
2
votes
1answer
441 views

Where query in Joomla component - what file do I edit?

Okay, so I am completely new to Joomla and I am trying to edit the source files of a component I built using component-creator.com. I have a database which stores different data for multiple ...
2
votes
1answer
944 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,...
2
votes
1answer
757 views

Joomla install database configuration not recognizing MySQL

I'm trying to get myself up and running with Joomla for the first time, I've installed the full LAMP stack and navigated to my joomla install by going to the local host in my browser 127.0.0.1/joomla. ...
2
votes
1answer
57 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
1answer
5k views

Run MySQL Query From Button Click

How can I run a MySQL query from the onclick event of an HTML button on my site? For example if my button is created like so, how could I use this to run a MySQL query titled AddInfo <p><...
2
votes
1answer
578 views

How to read resp. parse Joomla session data read from database?

Is there a way to read respectively parse Joomla session data in PHP as session_decode() and unserialize() are not working on that values? In my component I need to read data from all active non-...
2
votes
3answers
755 views

Ordering a UNION

I have two queries that I am unioning and would like to order them. I would like to order them on the second element, the date. My queries look like this: $query2 ->select ($db->quoteName(...
2
votes
1answer
56 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
1answer
341 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 ...
2
votes
2answers
224 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 ...
2
votes
1answer
545 views

JDatabase, SQL statement template

Is there a way to use a statement template, like by Hibernate HQL? SQLQuery sql=s.createSQLQuery("SELECT AVG(RATING) as r, COUNT(*) as c FROM RATINGS WHERE ADVENTURE_ID = ?"); sql.setParameter(0, ...
2
votes
2answers
2k views

Copy partial site content from old site to new site

I am trying to copy content from an old joomla instance to a new joomla instance. We archived the old site and created a completely new site with the same version of joomla both sites are at 3.6.4. ...
2
votes
2answers
18 views

Jdatabase: Finding part of the string which doesn't match $X string

I use some mysql queries to retrieve data from a Jdatabase table as strings. Now I need to find the part of that string which doesn't match another string (which actually is a sub-string of the main ...
2
votes
2answers
119 views

porting data from mysql to another mysql database

Is there a way I can port data from one mysql database table and transfer it to another mysql database table. both of these mysql databases are joomla databases, and i would like to transfer ...
2
votes
1answer
2k views

How to check whether a specific row exists in a JDatabase table?

What would be the best way to check whether a specific row exists already in a JDatabase table? Instead of INSERT INTO Command, I need to execute a UPDATE command if the row already exists. Help ...
2
votes
2answers
582 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 ...
2
votes
1answer
371 views

Joomla 3 stored mysql procedure output how to format

It maybe something simple, but I keep trying and can't get it done. I'm using Joomla 3 with a mysql backend that has a custom made procedure (blogvote(i int)) which returns votes and assigns points ...
2
votes
2answers
2k views

Get ID of deleted database-entry

I would like to create a delete-method, which deletes an entry in a table AND the attached entries in a second table. This is my source so far: // Delete entry in users_handles $db = ...
2
votes
1answer
75 views

Select new / modified rows from table

Using standard Joomla database functions, what's the right way to select new / modified items from a table? I don't want to use created > DATE_SUB(NOW(), INTERVAL 1 DAY) OR modified > DATE_SUB(...
2
votes
1answer
3k views

How can I retrieve data from MySQL table and insert it into QR code using PHP?

I have this PHP code that should retrieve data from a MySQL database and embed it into a a QR code: <?php include(JPATH_LIBRARIES . '/phpqrcode/qrlib.php'); $db = JFactory::getDbo(); ...
2
votes
1answer
89 views

How to improve the speed of a Joomla site launched at Server2Go

I created a website with Joomla 1.5 and i am using Server2Go as my local server and this site will be used for presentation purposes in a CD. So, this site is about to 500 MB with its database ...
1
vote
4answers
3k views

Display a Value from a Specific DB Field

I'm trying to figure out what I've got going on here thats not working - I'm using RsTicketsPro and I'm trying to pull a specific value from their custom fields section in the database. I reached out ...