Questions tagged [query]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
64 views

How to use {exp:query} results in {exp:channel} parameter?

Since i can not retrieve {parents} from grid field, i am trying to find simplest workaround. This works great: {exp:channel:entries channel='channel-one' entry_id=' <?php $...
0 votes
1 answer
36 views

tracking query parameter

We need to store a query parameter (gclid) in a cookie - if it exists. Using Cookie Plus on an EE 2.8 installation. ie: domain.com/page?gclid=12345 How can I detect that the query exists and then ...
0 votes
1 answer
71 views

Add new Channel ID access to multiple member groups via SQL Query

I have created a new channel (in this case ID#32) on an existing EE site install, and I need to assign it to 270 existing member groups. Rather than clicking into every single member group and ...
2 votes
3 answers
3k views

Get all entries where expiration date is within last 12 months

I know this is more of a SQL question, but I'm having trouble getting EE to cooperate. I have entries that expire, and want to show only entries which have expired in the last 12 months. I tried: ...
1 vote
1 answer
175 views

Getting Channel Entry Data With AJAX

EE 5.2.2 I am making an app that lists channel entries in a template. Some of the data in these entries could be very substantial so I would like to only call that data if/when the user chooses. The ...
0 votes
1 answer
41 views

Get average rating from a Super Search results set

I have a series of super search results listing pages displaying lists that are all rated with the Ratings module. I want to get the average rating of all the entries in the list to put into schema ...
0 votes
1 answer
132 views

Querying for a relationship field

I am building a web portal to display a list of servers and their designated applications in an HTML table. The channel I am using for the parent is called 'servers'. Inside this channel, I have a ...
1 vote
1 answer
201 views

Create an entry from an extension?

Is it possible to use the model service to create a new entry? I have been using the model service recently to update and delete channel entries, but can't figure out how to create. $update_query = ...
0 votes
1 answer
222 views

Model service filtering by date

I have recently started using the model service to query channel entries. $query = ee('Model')->get('ChannelEntry') ->filter(...); I have been using EE's documentation to ...
0 votes
1 answer
36 views

total_results of plugin nested within exp:query

I'm using the exp:query module along with a nested custom plugin that I've created. I need to get the count and total_results of the nested plugin but it's returning the count and total_results of the ...
0 votes
1 answer
15 views

SQL help to remove an imported text error

We recently migrated a site, and any line break imported as /n. This was not a huge deal for the templates, but it is for the entries. This is for an EE3 site, and I just don't write SQL code that ...
3 votes
1 answer
9k views

Get specific value without having to loop with db class

So I am trying to get a specific setting out of the database. And it seems that most of the CodeIgniter DB actions don't work in ExpressionEngine( http://ellislab.com/codeigniter/user-guide/database/...
1 vote
1 answer
122 views

How to use an SQL query to display entries from last 45 days

I'm using the following SQL query to populate a filter form for a jobs site. The query displays all locations used in the jobs listed on the site. I'm only displaying jobs up to 45 days old on the ...
1 vote
1 answer
66 views

Need query that filters entries by category

I need to display entries from Channel 1 and entries from (Channel 2, Category 1). I'm guessing the meat of the query would be something like this: WHERE channel_id = 1 OR (channel_id = 2 AND cat_id ...
1 vote
1 answer
209 views

ExpressionEngine 3 module: create custom member field programmatically

I'm creating a custom member field programmatically. This works fine, except that I want the database column to be dynamic based on what's already in the database. In my code below, the ...
0 votes
2 answers
99 views

Channel data not displaying in channel loop, but does display in query module tag

I recently had a client referred to me who has an existing EE build, v2.73, and some of their entries just stopped displaying on their templates. According to them, no code has changed and no software ...
0 votes
3 answers
233 views

SQL Query to Get count of entries of a certain status inside channel

Right now I have this inside of a channel entries tag. {exp:query sql="SELECT total_entries FROM exp_channels WHERE channel_name = '{url_title}'"} {total_entries} {/exp:query} Which provides me ...
1 vote
2 answers
132 views

Removing duplicate entries using an SQL query

I'm trying to create a search field (using Solspace Super Search) using a location from existing channel entries. Unfortunately this results in duplicate locations as some entries use the same ...
0 votes
1 answer
78 views

Dynamic Template Name in URL

On a single entry page, I want to display a list of categories an entry is assigned to, and these categories should link back to their respective pages. Now those categories are attached to different ...
0 votes
1 answer
88 views

Passing a GET variable back in a query while using mysqli_real_escape_string()

I'm trying to take a variable that's passed in a query string (GET) and then use that variable to do a SELECT based on it... // Assign query string to a variable while sanitizing it against XSS $...
0 votes
2 answers
134 views

Low Search and match 3 fields and then return data

I'm looking for a bit of guidance here, just need pointing in the right direction for. A solid solution. Would this be possible with ExpressionEngine? Either using something like Low Search or even ...
0 votes
1 answer
120 views

query : how to get the value of a custom field within a relationship field?

I have a channel 1 and a channel 2. In channel 1 I have a relationship field that relate to channel 2. I want (by making a query, for reasons I won't explain here because this is not important) to ...
0 votes
1 answer
77 views

Query exp_channel_data but exclude expired entries

I'm on EE2.10.1, and trying to grab unique countries from a channel that has one field for "country name" and one field for "country code". So I've got the following query: {exp:query sql="SELECT ...
0 votes
1 answer
155 views

SQL query issue while trying to count the entry (row)

Trying to produce a current entry count / total entries within a channel_entry tag by using a SQL query. {exp:channel:entries channel="{channel}" limit="1" require_entry="yes" status="open" ...
0 votes
1 answer
137 views

Query and Playa Field

I'm running a query on a playa field and the output is grouping a few values together. I just want to be able to access the second and third parts but am a little confused how to do it. Code: {exp:...
0 votes
1 answer
29 views

Expression Engine 1.x Page deletion db query

Does any one know of a custom query to extract when a page was deleted in Expression engine 1.x. We have a couple pages that just disappeared and the higher ups wants answers. Any help would be ...
0 votes
1 answer
138 views

Forbidden: You do not have permission to access this document - When attempting to save a Template

EE Version 2.10.1, PHP 5.3.27 Neither have been updated since installed. And as much as I would LOVE to upgrade to EE v3.x, I cannot due to some of the Add-Ons not having been upgraded. This appears ...
0 votes
2 answers
179 views

Need help with a query to get data

I need a complex query and have gone beyond my scope of understanding. Here is the gist... There is a section of the site in which users can select various values available in entries of a ...
0 votes
2 answers
157 views

Can you query a grid field to return a list of distinct fields?

EE 3.1.4 I need to get a detail field from a grid field, but I also need the results to be distinct. The issue I have is the grid field returning a pipe delimited field set. So running something ...
0 votes
2 answers
64 views

Create list of authors, but no repetion (LOW search)

We have build a site where members publish images in entrees which are tagged ( one or more tags). By using Profile:edit there also exists a channel with Member_data like name and adress. The ...
1 vote
1 answer
160 views

URL segmentation GoDaddy

I have a problem with GoDaddy hosting. It seems that URL segmentation is not working, so I get link like this http://example.com/?/main/url_title and I need link like this http://example.com/main/...
0 votes
1 answer
35 views

List authors by number of posts in specific channel

I need to display a list of authors that have posted in a specific channel, sorted by number of posts in that channel. I've got this: {exp:query sql="SELECT screen_name, total_entries, member_id FROM ...
1 vote
1 answer
31 views

SQL help - clear all the values of a specific field

We ran a batch import to pull in several hundred entries, but some fields got imported incorrectly. For example, all the websites imported as "link", when they should have been blank. Can someone ...
0 votes
1 answer
125 views

SQL query in a channel:next/prev_entry to output an image in a matrix column

I'm trying to create a Prev / Next navigation system using thumbnail images. The images for each entry are held in a four column matrix field (field_id = 8). I just want the first image held in the ...
1 vote
2 answers
78 views

Playa related entries count

We are running reports and need a query - we're using playa and I want to get the total number of child_entries where channel_id = 16 and where the 'parent_field_id' = 68. My current query is: ...
0 votes
1 answer
55 views

Total entry views for all entries in a given category

We have a basic query, which get us; cat_id, parent_id, cat_name and the total entry_count which is then displayed in the form of a report... the current query is: SELECT c.cat_id, c.parent_id, c....
0 votes
2 answers
266 views

EE DB Class question

I've got this code: $res = $this->EE->db->where(array('EventCode' =>$r["eventcode"])) ->limit(1) ->get('exp_course_events'); $course_date = $res->row('FormalDate'); ...
1 vote
1 answer
96 views

MX Select Plus CE - problems with SQL Query

I've added MX Select Plus CE in a Matrix row. The objective is when the user is digitizing inside the select options, appears "on the fly" the "title" of theses entries of a specific channel. I chose ...
0 votes
1 answer
316 views

How do i search for a specific username by id

i am trying to find out how to search the cms database for a specific users username based on their user id and not based on logged in. Any documentation links or advice would be great, have tried ...
0 votes
2 answers
171 views

Is there a way in Expression Engine to bulk close entries that contain a specific string?

I have old data that has been migrated into a new design. The old data contains multi-language data using 4 different languages and Transcribe. The new site does not contain transcribe, nor does it ...
0 votes
1 answer
109 views

How can I retrieve the site name from a channel entry as a query?

I have a plugin that I am editing at the moment and I am looking to do a query that takes the site_id from a channel(not a channel entry) and then grabs the id and passes that through a function that ...
0 votes
1 answer
130 views

ExpressionEngine 2.7.3 How do I directly execute a query against the database?

I navigate to Tools | Data | SQL Manager Select "Database Query Form" select table_name from information_schema.columns where column_name = 'flippityfloop' I select "Enable MySQL Error Output" and ...
1 vote
0 answers
104 views

Slow queries from ExpressionEngine

I need help with the following query. I'm not sure where it comes from in ExpressionEngine. Any insight or pointers would be helpful. SELECT DISTINCT `L0`.`field_id` as L0_field, `L0`.`...
1 vote
2 answers
127 views

Create a list of entries where parents status is open

I have 2 channels, artists and artwork. I want to display the artwork entries where their parent entry, in the artists channel, has the status set to 'open'. I would like to show all the fields from ...
0 votes
0 answers
91 views

Show entries where relationship field equals Yes with the Query

I have 2 channels, one called artists and another called gallery. In the artists channel there is a checkbox to say if the artist has given permission for their work to be shown. In the gallery ...
0 votes
1 answer
145 views

Custom query ignoring sticky entries

I'm using the query module, to return a list of entries sorted alphabetically, but there are a few sticky entries that I need to appear at the top of the list, and the stickies are being ignored.Here ...
1 vote
0 answers
24 views

EE If conditional inside a exp:query tag within <script> tags not being parsed [duplicate]

I have some javascript in a template that has some values set via the output of a query tag, I've stripped the template right back to contain just the following: <script> $(function() { $( ...
2 votes
1 answer
610 views

SQL Query to get entries with their categories

I have the following query that is grabbing entries, but I would also like a 'categories' column that will show a pipe seperated list of the categories assigned to each entry. I have tried using ...
0 votes
1 answer
126 views

MySQL query to output variables grouped by entry status

I have schools, teachers and students channels with each of the students and teachers channels with a field that contains the entry_id of the school they're related to (not actually using native EE ...
0 votes
2 answers
103 views

What's wrong with this SQL query?

I have an SQL query which I'm adding to a small search plugin, however when I run the SQL in MySQL it works and results are found, however no rows are being returned when running the code in the ...