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
1
vote
4answers
16k views

The MySQL adapter mysqli is not available - how to resolve this issue?

My website www.EliteMaths.com.au has been active until early this week. When I tried to access it this morning I got the following error message: Error displaying the error page: Application ...
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); $...
1
vote
5answers
2k views

Joomla 3.3.0 very slow

I am running Joomla 3.3.0 on a VPS and it is extremely slow. In fact, it's the slowest I've ever seen Joomla load before (Can take upto 5 minutes to load the article editor!!). Any ideas what could ...
1
vote
2answers
368 views

Error Offlajn extensions

The contact page of my site ( [url]https://www.portal-gestao.com/contactos.html[/url]) is returning the error: Table 'portalge_2015.j30_offlajn_forms' doesn't exist SQL=SELECT fields FROM ...
1
vote
2answers
238 views

Database query outputting twice

I have the following database query: $database = JFactory::getDBO(); $database->setQuery("SELECT items.headline, items.image, items.copy, items.source FROM ...
1
vote
2answers
1k views

Migrating Joomla site to local machine

I borked a Joomla site while trying to upgrade to Joomla 3. One of the extensions was not supported and I had to restore my backup, including the backup of the database. Unfortunately, it did not work ...
1
vote
1answer
71 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
147 views

Why my custom query only returns one result?

$dbwsk = JFactory::getDBO(); $querywsk = "SELECT `title` FROM `#__content` WHERE 1"; $dbwsk->setQuery($querywsk); $rowswsk = $dbwsk->loadResult(); var_dump($rowswsk); I've been working and ...
1
vote
1answer
291 views

MySQL SELECT query with LIMIT to show a maximum of 3 images

I want to show up to 3 images that are assigned to the logged in user in a database table. I have written the following MySQL query: $db = JFactory::getDBO(); //GET GALLEERY IMAGES $query ...
1
vote
2answers
3k views

What does 'lft' and 'rgt' do in #__menu table?

I was trying to manually add menu item to the database. See this question, when I notice these two fields in the #__menu table. It seems to me they are auto increasing by 2. For example, if the latest ...
1
vote
2answers
315 views

Quotes Displayed in Database Value

So any profile data filled in within a user profile for joomla is being saved with quotes around it in the database. Does anyone know how to remove the quotes? It seems to do it even as the default ...
1
vote
2answers
300 views

Storing data in a single column of a table OR as the part of json

I'm creating my own component for storing products (shopping cart). The most of products usually have their prices and other attributes. What way of storing these attributes in the DB is easier and ...
1
vote
2answers
53 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
2answers
79 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 ...
1
vote
1answer
132 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
2answers
913 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-...
1
vote
1answer
787 views

SQL WHERE clause with a variable (current article ID)

I am trying to do a simple calculation on two Joomla custom fields in a module. I get the article ID as a variable and want to put this in the WHERE clause to get the right custom field value. Have ...
1
vote
1answer
328 views

Optimize Joomla SQL Query to store data in array and pass on array output to field

I have built 2 queries $id = JFactory::getApplication()->input->getIn('vid'); $db = JFactory::getDbo(); $db->setQuery("SELECT `email` FROM `#__usedcar_variants` WHERE `id`='$id' LIMIT 1"); $...
1
vote
2answers
297 views

getting some sql error

I have recently restored my joomla website and it was working perfectly fine, but suddenly I am receiving the following error: 1064 : You have an error in your SQL syntax; check the manual that ...
1
vote
2answers
935 views

Transforming a Query for JDATABASE

I need to transform a simple php query into a query that JDATABASE will understand. Here is the example: $resDays = 7; // On how many days to build the top? $resLimit = ...
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....
1
vote
1answer
82 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
137 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 ...
1
vote
2answers
102 views

How to re-write sql for joomla JDatabase

I am new to custom Joomla coding so excuse me for this, I want to execute the following statement: "SELECT MAX(CASE WHEN v.FieldName = 'Team_Name' THEN v.FieldValue END) 'Team_Name' , MAX(...
1
vote
1answer
58 views

What's the proper chaining for WHERE

This statement works: $query = " SELECT COUNT(*) FROM " . $this->s_createtableName . " WHERE tm BETWEEN UNIX_TIMESTAMP(DATE(NOW())) AND UNIX_TIMESTAMP(DATE(NOW()) + INTERVAL 1 DAY)"; In ...
1
vote
1answer
2k views

Refreshing module/div on form submit [without page reload]

I have this simple search form inside a custom module. HTML FORM: <div id="search-form"> <form action="" method="post"> <input type="text" name="roll_no"> <input type="submit" ...
1
vote
1answer
350 views

Errors processing query result set: Undefined variable and Trying to get property of non-object

I already have a database table called "form"; I added a new field in same table. The problem is in the query select * from "form". While the old fields display, the new field doesn't. I have no ...
1
vote
3answers
798 views

PHP function with JDatabase queries

I have these two blocks of identical code in one of my PHP modules. The only difference between these two blocks is that in first block it is ... active = ' .$db->q('1')); and in the second block ...
1
vote
2answers
512 views

Selecting data from 2 tables and inserting into a 3rd table

Could someone help me to create a query using the Joomla API? I've been going round in circles. What I have so far: <?php // Get a db connection. $db = JFactory::getDbo(); // Create a new query ...
1
vote
2answers
5k views

Run UPDATE query on SELECT query result

I want to run an UPDATE query on a record after selecting it. $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query ->select(array('p.*', 'u.id', 'u....
1
vote
3answers
1k views

Reformat DATETIME type value to European date format

I have a select query which returns a DATETIME value (stored format: YYYY-MM-DD HH:MM:SS). I want to show this on my site in "Euro date format" in other words d-m-y format. So what sql code should ...
1
vote
1answer
180 views

Database datatype for Joomla Standard Form Field “usergrouplist”

What is the correct MySQL database datatype to be able to store the form data of the Joomla Standard Form Field usergrouplist? Since Joomla 3.2 usergrouplist should be used instead of usergroup. As ...
1
vote
3answers
1k views

How to get the generated id after a successful INSERT query?

I would like to get the id of the last saved dataset in a JTable-Operation. At the moment I got this: // Create and populate an object. $value = new stdClass(); $value->userid = (int)$...
1
vote
1answer
543 views

Two left joins and multiple parents for a single record

This issue is extending of the question(s) by the link joomla.stackexchange.com/a/9836/4042 but with condition when child record has not only ONE parent (parent record) but MANY. With two left joins ...
1
vote
1answer
95 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
2answers
137 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
1answer
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
1answer
408 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
1answer
425 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
1answer
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
1answer
68 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
1answer
67 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
3answers
112 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
1answer
74 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
40 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
256 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
144 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
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 ...
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
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 ...