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
0 answers
44 views

Joomla 3.10.11 on server with MySql 8.0

On my online server which has MySql 5.7 and PHP 7.4 I have three sites in joomla which have the following: Mywebsite1 with joomla 3.10.11 and JD Boston template with Helix framework 3.0.3 Mywebsite2 ...
Jackom's user avatar
  • 101
0 votes
0 answers
8 views

Error 0 Call to a member function get() on null on $db query in com_content category blog.php override

For a J5 site, using Cassiopeia, I have created (on a test site) a View using SQL in phpMyAdmin (which uses mySQL) that selects * from the content table linked by content.id and fields_values.item_id ...
Gillian's user avatar
  • 411
0 votes
0 answers
38 views

_template_styles' doesn't exist

I'm getting a weird error; here is the data below. I'll first start by telling you what I did and why. I have a client with a hacked Joomla site. For safety's sake, I installed a new Joomla and all of ...
Eoin's user avatar
  • 1,909
1 vote
2 answers
54 views

Best way to save timestamp for new or modified records in custom component

In my custom component I have two database tables for items in my component with the standard 'created' and 'modified' datetime columns to contain timestamps when those items are created or modified. ...
Grant Hood's user avatar
0 votes
1 answer
12 views

Subquery error when using 3rd Normal form - 500 Operand should contain 1 column(s)

I'm fighting to get the following structure to work. I have three tables: players, player_teams, teams I used the conclusion I've found here for one of my questions: Join one to many with helper table ...
Marco's user avatar
  • 663
1 vote
1 answer
191 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 ...
yowww23's user avatar
  • 11
2 votes
2 answers
109 views

Is insertObject sanitizing the inputs?

Let's suppose I want to insert a new record into a table. Let's suppose that the table is of the structure of mytable(id, my_text); So, for example, we are to insert a new record, I would like to ...
Lajos Arpad's user avatar
0 votes
1 answer
310 views

MySQL "LOAD DATA LOCAL INFILE" with database connection object in Joomla 4

In order to import large CSV files into a Joomla database table, I use the MySQL "LOAD DATA LOCAL INFILE" command as follows: $db = $this->getDbo(); $sql = "LOAD DATA LOCAL INFILE '&...
cappu's user avatar
  • 139
0 votes
0 answers
104 views

Multi-level Dependent Drop Down Lists by Joomla 4 SQL Custom Field

I need to create a Multi-level Dependent Drop Down List to show my Joomla Categories list in the first dropdown list and then show the related articles in the second dropdown list (based on the value ...
KEian's user avatar
  • 3
0 votes
1 answer
132 views

Using MySQL "LOAD DATA LOCAL INFILE" with the Joomla database connection object

In a Joomla 3 component I use the MySQL "LOAD DATA LOCAL INFILE" command to import large CSV files into a Joomla database table. When moving to a new server, it is no longer possible to ...
cappu's user avatar
  • 139
0 votes
2 answers
35 views

UNION Query with loadAssocList($key)

So here is a small example of the query I play around with: $db->setQuery('SELECT position, title FROM jos_modules UNION ( SELECT position, title FROM jos_modules )'); $data= $db->loadAssocList()...
maidan's user avatar
  • 423
1 vote
1 answer
223 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 (...
excyberlabber's user avatar
2 votes
3 answers
95 views

Find row with lowest column value per group, then join distinct group data to another table

I need a hint for this problem, trying for days already to solve it: THE PROBLEM I am working with an Joomla extension which has this 2 tables of interest: COMPANIES PRODUCTS A module lists all ...
Steven's user avatar
  • 35
1 vote
1 answer
178 views

How to combine or merge SQL results into one row

I have a Joomla list page that I am trying to build each row from multiple tables that I haven't been able to figure out how to do efficiently with MySQL and would like some assistance. I suspect the ...
Irata's user avatar
  • 3,927
1 vote
2 answers
152 views

How to use NOW() with DatabaseDriver->insertObject()

I'm inserting an object in a database table using joomla 4, as per joomla docs: $toInsert = new stdClass(); $toInsert->update_timestamp = 'NOW()'; $toInsert->id = null; $db = Factory::...
Jimmy's user avatar
  • 327
0 votes
0 answers
236 views

Connecting to an external database in Joomla 4 - further problem

I have seen the earlier question on this subject and tried the suggested code: $db = (new Joomla\Database\DatabaseFactory)->getDriver('mysqli', $options); but get an error: An error has occurred ...
johnonorvic's user avatar
1 vote
2 answers
74 views

Insert datetime type into created column from PHP file from module/component

I can't get the created column filled when inserting items into the database. I am using this code: function createRecordInLSFCDBTable($id, $userId) { echo 'createRecordInLSFCDBTable: ' . $id . ',...
purple11111's user avatar
0 votes
0 answers
127 views

Using Like with wildcard in joomla php query

Hi I am struggling to get an output from a wildcard query. I am using the following code which outputs the following error: 0 Unknown format specifier "$" $iban = '...
OnTarget's user avatar
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 ...
Ruchika's user avatar
  • 415
2 votes
0 answers
67 views

Very slow HTTP response times possibly due to SEF rules in htaccess

Im running Joomla 3.X and can't seem to pinpoint why I'm getting such high HTTP response times. I think I narrowed it down to the SEF rules in my .htaccess I ran some tests and thought to post my ...
Nick's user avatar
  • 51
1 vote
1 answer
906 views

Connecting to an external database in Joomla 4

Connecting to an external database in Joomla 3 is easy following this documentation and works like a charm. But JDatabaseDriver->getInstance method is deprecated in Joomla 4. What is the ...
Peli's user avatar
  • 103
1 vote
1 answer
67 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.`...
GalanopD's user avatar
3 votes
2 answers
2k views

Joomla 4 create article programmatically

I have tried a few ways to create articles programmatically in Joomla 4, but none of my attempts are working. First is to insert data by mysql using $db->getQuery(true) -- the article shows in the ...
Na Nguyễn's user avatar
1 vote
1 answer
330 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 ...
Eoin's user avatar
  • 1,909
0 votes
1 answer
319 views

Pulling api data and saving to mySQL

So, I am trying to pull data from EA Sports API for games like NHL or FIFA. The issues with EAs API is it only shows the last 5 games played. I am trying to have a script run every minute and save ...
Brandon's user avatar
  • 69
3 votes
1 answer
314 views

Is the following everything one should do to prevent SQL injection?

In order to sanitize the user input in an article insertion form (title and HTML content), here are the bits that I've included: Use of JInput: $jinput = JFactory::getApplication()->input; get ...
Vincenzo Oliva's user avatar
0 votes
1 answer
116 views

How to return data from 2 tables to one table using a select field

My tables: dzialki +--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+---...
Dariusz Tokarz's user avatar
0 votes
1 answer
233 views

Implement SELECT query with a LEFT JOIN in J4

I want to get data from two tables using a LEFT JOIN. My query works in my current PHP code, I just don't know how to implement it with query building methods in J4. Can anyone help? SQL: SELECT `...
Dariusz Tokarz's user avatar
0 votes
0 answers
131 views

How to encrypt and decrypt User data in joomla

I am new to joomla, and working on joomla application which is currently running on production environment. Application contains 1000+ registered users. As per GDPR Policy, I have requirement for ...
Akoli's user avatar
  • 1
2 votes
0 answers
116 views

MySQL Server has gone away with mysqli_connect to another LAMP Stack / TURNKEY Linux

I am trying to connect to another VM (192.168.16.27) from 192.168.16.28 to get Data out of the MariaDB Database (joomla). So my Code is: $link = mysqli_connect("192.168.16.27", "user&...
alb's user avatar
  • 31
1 vote
1 answer
412 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 ...
random beco's user avatar
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 #...
Gocha's user avatar
  • 83
0 votes
2 answers
6k views

Error: Failed to start application: Failed to start the session

I have hosted web application develop using joomla in ubuntu 20 and use mysql as database. one i hosted and viewed in the web browser it show me Error: Failed to start application: Failed to start the ...
udakila's user avatar
2 votes
2 answers
751 views

How to join custom fields data to users table without extra rows in result set

I have rudimentary knowledge of SQL (when it comes to anything but single tables) and am trying to come up with a query that will give me all the custom fields for my users. This query will give me ...
Josef Zeevi's user avatar
0 votes
1 answer
396 views

How to create menu item in admin menu Joomla 4 in php+mysql in module, plugin?

How to create menu item in admin menu Joomla 4 in php? From plugin/module for Joomla4?
aleks_yolp's user avatar
1 vote
1 answer
65 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)) ...
Elaine Byene's user avatar
0 votes
1 answer
193 views

2014 Commands out of sync - MySql query J4

I've come across this error when performing some database queries in my J4 site model: $db->setQuery((string)$query); try { $rows = $db->loadObjectList(); } catch (...
Glenn Arkell's user avatar
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 ...
GalanopD's user avatar
1 vote
1 answer
348 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 ...
Brandon's user avatar
  • 69
1 vote
3 answers
313 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 ...
RogerCO's user avatar
  • 61
1 vote
0 answers
49 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=&...
RustyJoomla's user avatar
  • 2,078
1 vote
1 answer
124 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 ...
GalanopD's user avatar
0 votes
0 answers
268 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....
JShahi's user avatar
  • 7
1 vote
2 answers
207 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 ...
Irata's user avatar
  • 3,927
0 votes
2 answers
65 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 ...
Marcin Sypniewski's user avatar
1 vote
3 answers
361 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, #...
Andreas Soraru's user avatar
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 ...
Leoalv's user avatar
  • 167
2 votes
1 answer
94 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 (...
user1616338's user avatar
1 vote
1 answer
93 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, ...
Azhar A's user avatar
  • 11
1 vote
2 answers
302 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 ...
saeed's user avatar
  • 43

1
2 3 4 5 6