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
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 ...
3
votes
3answers
131 views

Is there a file that defines error messages?

I would like to catch some exceptions to inspect the error code and determine if I should re-throw it with a more user friendly message. This would probably be most beneficial with MySQL errors. Is ...
2
votes
1answer
59 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><...
0
votes
2answers
494 views

Slow query issue!

Maybe someone can help me with this issue. My site has a slow query: SELECT DISTINCT i.*, g.title AS groupname, c.name AS category, v.name AS author, w.name as moderator, u.name AS editor FROM ...
0
votes
1answer
151 views

Using jimport in ajax php file

I run a fantasy football website. My League Registration is handled through a form and mysql database. This all works well. Once I hire a manager, I want to create a Joomla user for the user. ...
2
votes
2answers
590 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 ...
0
votes
1answer
158 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
513 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 ...
0
votes
2answers
982 views

How to make a mysqli connection and execute a SELECT query in Joomla?

I am having an issue with a basic query in PHP. The query runs perfectly in PHPMyAdmin, but in the browser I am getting: Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, ...
0
votes
1answer
1k views

Select data from multiple tables with different name and columns

I have this problem that I can't resolve. In CMS Joomla I need to select data from table #__adsmanager_ads column ad_healine and from table #__modules column title. Then check if ad_headline == title ...
0
votes
2answers
1k views

How to run delete sql query with multiple values in Joomla?

I would like to run a delete sql query with multiple values in it in my joomla site. But I am unable to do so. So I need your help on this. In controller.php page: function deleteFiles() { ...
3
votes
2answers
2k views

Adding Multiple Users in Joomla

How can to add multiple users in Joomla 3 without using an extension? Thank you! :)
1
vote
2answers
304 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 ...
5
votes
3answers
1k views

How to rewrite SQL-query with CASE/WHEN to Joomla-based "format"

I have the following SQL-query to database: $jinput = JFactory::getApplication()->input; $category_id = $jinput->get('virtuemart_category_id'); $db = JFactory::getDBO(); $query = $db->...
0
votes
2answers
294 views

What is the Joomla database code for the group_concat from tables joined by a third

I am looking to group_concat the results from the fields from multiple rows where there is a an intermediate table '#__ext_resources' a.id a.title 1 Blaa 2 Blee 3 Blii Joining table '#...
3
votes
4answers
607 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 #...
2
votes
1answer
162 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 ...
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 ...
0
votes
2answers
306 views

Database error importing from localhost to live site?

I've been using Xampp for Mac and the latest version of Joomla. I uploaded the site/database to a live server a couple weeks ago for a developer to look at a problem I was having specifically with ...
5
votes
3answers
2k views

What to use instead of getNumRows() in Joomla 3.x

It is my understanding that $db = JFactory::getDbo(); $db->setQuery($sql); $db->execute(); $numRows = $db->getNumRows(); Does not work in Joomla 3.x, right? I get a "...
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. ...
1
vote
1answer
638 views

MySQL Update query not working

This update query is not working and I've triple-checked the general syntax for the update queries in Joomla via the documentation..Here is the code from the controller-side: public function ...
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....
3
votes
2answers
563 views

Joomla Debug Console does not show Database Queries

My Joomla 3.4.4 website is not showing Database Queries in Joomla Debug Console at the site front-end but it can be seen at the Administrator back-end. Below is the screenshot at the front-end And ...
0
votes
1answer
76 views

Hide a value or data on table

I'm using this Mshah frontend user manager extension. I have below table and I want to hide the "Registered" value from that column, is that possible? As you can see, the third column is a user group ...
2
votes
1answer
374 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 ...
4
votes
2answers
749 views

Get Timestamp from Database

I have data stored in a db table, with an auto timestamp. In a module I want to then display a result based on the latest timestamp. It's not working and I'm getting an error Warning: strtotime() ...
1
vote
3answers
2k 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 ...
2
votes
4answers
791 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
1answer
588 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-...
1
vote
1answer
181 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 ...
3
votes
1answer
461 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->...
0
votes
1answer
336 views

Need altering sql-query with group_concat and two inner joins [closed]

I have the following two tables: #__records: id name 1 Child1 2 Parent1 3 Parent2 4 Child2 5 Parent3 6 Child3 #__parents: id child parent 1 1 2 2 1 3 3 ...
1
vote
2answers
938 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 = ...
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 = ...
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)$...
3
votes
4answers
997 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`...
0
votes
1answer
310 views

Smart search Indexer duplicate entry mysql error

I'm running Joomla 3.3.1 with MySQL 5.6.21 and I'm getting the following error when running an Index. It indexes 2 items and then stops. An Error Has Occurred Duplicate entry '1-0' for key '...
3
votes
2answers
1k views

Filter strings before saving them in the database

I just created a script witch fetches mails from IMAP and stores the title and content in the database. Of course I don't want to save these information without a check; I'm a bit paranoid but I ...
2
votes
3answers
285 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 ...
3
votes
3answers
3k views

How to get database information from Joomla category

I know how I can retrieve all information from a article in the database. I am trying to do the same thing for a category. And just for clarification, I am talking about when view is equal to category ...
1
vote
2answers
308 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 ...
3
votes
2answers
953 views

How to share table between 2 or more databases?

I have a Joomla! site and now I want to make some subdomains. But, I want that the users must be the same in both. Like, if a user logs on to the main site and then goes to the subdomain at the same ...
0
votes
0answers
97 views

Joomla 1.5 creating or editing back end user

I have a website in joomla , the problem is that when i am creating new back end user (administrator/super user) from joomla user manager it makes an entry in the users table after that it deleted it ...
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
1answer
557 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 ...
3
votes
4answers
2k views

How to write my MySQL query with JOIN logic using JDatabase methods?

I'm having a difficult time translating this SQL script to JDatabase methods because I can't find the AND query method. SELECT user.firstname, user.lastname, leadership.leadname, leadership.lead_des ...
5
votes
2answers
2k views

Two left join in one query to Joomla database

I have two tables: #__records and #__parents. In the first table some records may have parent records that are stored in the same table but relations between childs and parents are stored in the ...
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 ...