Questions tagged [sql]

Structured Query Language (SQL) is a language for querying databases.

Filter by
Sorted by
Tagged with
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 ...
1
vote
3answers
2k views

Retrieving multiple results from the database

I don't have much Joomla or PHP experience so I'm probably missing something really simple. I'm trying to load a certain list of user IDs into an array. This code works except it only loads one result....
4
votes
2answers
626 views

Join an existing table with a generated table of dates and count rows for each date?

I would like to use this complex mysql query in my joomla model to generate a timeline and count entries within a specific date range. My SQL Query is: SELECT T.calendar, COUNT(DATE(M.date)) as ...
0
votes
1answer
1k views

Use different mysql table for users

I need to integrate a users table instead of the default Joomla _user table. The table pref_users has simple id/user/email/password fields (not hashed). Is there anyway I can make Joomla use it ...
0
votes
1answer
436 views

Joomla MVC Component: Run SQL before deleting record

I have a course listing component, and each course as zero, one, or more corresponding sections for that course. Basically different versions of that course that run at different times at different ...
0
votes
1answer
334 views

How to merge joomla tag using SQL query from phpMyadmin?

Since Joomla does not have a tag merging feature, I'm looking for a way to merge existing tags using SQL query in phpmyadmin. Old tag_id=1 New tag_id=2 This query works as long as all of the ...
1
vote
2answers
465 views

Extension install scripts without raw sql

I am new to Joomla development, coming from Magento. Working through the tutorials with a certain extension in mind I stumbled upon a little problem. By now Joomla supports MySql and MSSQL and more ...
1
vote
1answer
129 views

Joomla 2.5 and Virtuemart 3 installation problems

I've tried installing Joomla 2.5 and Virtuemart 3 (full install download from Virtuemart's website) and I went through the installation process ok. However I've had a lot of errors come up and don't ...
2
votes
2answers
3k views

Error 1146 while installing K2 extension

While installing K2 extension, Joomla 3.0, GoDaddy hosting) received error message: Table 'iWebazoid.bq1ry_k2_categories' doesn't exist SQL=SHOW FULL COLUMNS FROM bq1ry_k2_categories Unable to ...
1
vote
2answers
807 views

How to Create a Foreach Loop that Returns Users In a Specific Usergroup

My goal is to create an html select box via a foreach loop that returns all users within a specific custom usergroup (ex. usergroup = Agents). Once, the query pulls in all records (users) for that ...
21
votes
1answer
13k views

How to combine ANDs and ORs in the WHERE clause using a Query Object?

Given the desired SQL below, where Cond1 and Cond2 must be met OR Cond3 must be met for selection, what is the correct way to use getQuery() to achieve it? Desired SQL: Condition1 and Condition2 ...
1
vote
1answer
131 views

Recycling IDs: re-using articles, category's ID that have been trashed for new articles

I like to work with small IDs. Is there a way to automatically re-use the IDs of trashed* items? (* when using "empty trash") Is it safe to run this query: ALTER TABLE jos_content AUTO_INCREMENT=0 ...
2
votes
2answers
338 views

Old update sqls being run on update

I'm building a custom component, and on initial install on Joomla 3.3.6 it installs properly. However, when I install again, rather than running the update sql only from the current version+, it ...
-1
votes
3answers
6k views

1054 Unknown column 'extra_query'

I have a new Joomla installation with this error: 1054 Unknown column 'extra_query' in 'field list' SQL=SELECT DISTINCT update_site_id, type, location, last_check_timestamp, extra_query FROM ...
2
votes
2answers
111 views

Component Update: DB error file function returned no error

I have been working on a component but noticed when I update it I get an error (something like "Component Update: DB error file function returned no error", not exact but close). I notice this is due ...
7
votes
2answers
516 views

Recommended practices regarding transfering database from Joomla 1.5 to Joomla 3

I want to transfer about 300 articles from a Joomla 1.5 website to a Joomla 3.3.1 website. I have access only to the Joomla 1.5 database but not to the backend (I have access to both for the joomla ...
3
votes
1answer
963 views

Migration Files - post update sql migration scripts generation

I am looking for an organised way to run joomla updates locally and then update production systems by means of code deployment + db migrations, so that i do not have to update joomla on production, or ...
1
vote
3answers
3k views

How can I select the IDs of a category and all its (n levels) subcategories?

Beside the parent category, I would like to recursively collect all of its child rows. (Pseudo code) SELECT IDs FROM #_categories WHERE parent = father As an alternative, SELECT IDs WHERE the first ...
6
votes
2answers
391 views

Structure folder of sql files in my component

What folder should I put my sql files in my component for joomla execute them automatically? If in the first version I created a table and in later version I want to change, how should I organize that ...

1
2