Questions tagged [query]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
59 views

Extensions - where to start

So, been using EE for some time but now want to push the limits and write some extensions and or plugin. The extension needs to write the entry_id of the entry just published by any user OR the ...
0
votes
1answer
431 views

Displaying Category Name and Channel Entry Data with Query Module

I have a SQL query set-up to display a list of entries based on the category ID found in the third segment, but I'm having a hell of a time trying to display the category name that goes along with it. ...
0
votes
1answer
207 views

Pass a UNIX Timestamp as a URL Segment to display entries edited since that date

I'm trying to create a template that will display a list of entries that have been added or edited since a particular date. The date would be passed as a UNIX timestamp in the URL like so; mydomain....
0
votes
1answer
57 views

Extracting category ID of an entry and then using it to display more entries

I'm wondering what the best way to do this may be. I probably haven't worded the question in the best way so I'll explain. Basically, I have an entry on page which is assigned to a category. On the ...
1
vote
1answer
82 views

Can't save templates containing Query tags

I've set up a staging server for an existing EE2 website, when I make changes to templates and save most templates save ok, but when I try to save a template that has an EE query tag, I get the ...
0
votes
1answer
43 views

EE Not Outputting All Data Using Query, for Data that Has NULL values in a Field

Using the following Query in my template will not output the title of entries that do not have the ci.filename. BUT when running the SQL in MySQL directly, it does produce the results, including the ...
0
votes
1answer
587 views

Total no of row returned for exp:channel:entries?

{exp:channel:entries channel="channel_1"} //how do i find the total no of entries retuned without exp:query? {/exp/channel:entries} I want to find the count first and then loop?Any idea
1
vote
0answers
193 views

Can I use MySQL session variables within a query in my template?

I'm trying to execute a query similar to this: SET @last_date = NULL; SELECT IF(dates.first_entry = 1, DATE_FORMAT(FROM_UNIXTIME(col_id_122), '%W, %M %d'), NULL) start_date, DATE_FORMAT(...
0
votes
1answer
299 views

how to put a category condition with exp:query?

{exp:query sql="my query"} {/exp:query}. This works fine.But I want to give a category condition to it.When I do it,it does not flter the data accordingly. for example: {exp:entrie:channel ...
0
votes
1answer
354 views

How to display sub categories using the query module

I'm using the query module to display a category, but how to use query to display the child categories?? It is possible?? Thanks, Stéphane
2
votes
1answer
115 views

Query a NON EE table in database?

I have a HTML table where a user can subscribe.I send an ajax call when the user clicks the subscribe button and store it in a non ee table.Next time when the user comes on the same page,I want to ...
1
vote
1answer
27 views

can you show screen_name of users who have liked an entry?

Channel Ratings: 4.0.4, EE: 2.7.3 I am using the channel ratings "Like" function, so the logged in users can "Like" certain products. I want to be able to display who has liked an entry. I am using ...
1
vote
1answer
912 views

How to add categories to a SQL query that outputs channel entry data

I'm trying to create a query that will output all the entries in a channel. I'm wanting to output the title, some custom fields, and the categories that the entry belongs to. Each entry will belong to ...
2
votes
3answers
2k 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: ...
0
votes
2answers
136 views

Channel images find entry with no set image

I'm making a site for a client which has about two thousand news entries that were imported from a WordPress installation, each entry is using a channel images field. However some entries are missing ...
1
vote
1answer
79 views

htaccess redirect from non query url to query url

I'm trying to redirect a url from a non-query version to a query version with EE. I can get the redirect working properly on a .php flat-file, such as: RewriteCond %{QUERY_STRING} ^$ RewriteRule ^...
1
vote
1answer
224 views

Limiting results returned by nested playa parents tags

I'm hoping someone can give me a pointer on narrowing my returned entries on the basis of nested playa parent relationships. Here's the scoop: I have a 4 inter-related channels: companies, people, ...
2
votes
1answer
170 views

Passing entry_id to json to get Playa children

I need to be able to do pass the entry_id of the page being viewed into a json file to build a query. I currently have a page setup that has a Playa field. I need to have a JSON file that will get ...
1
vote
1answer
108 views

Get query of exp:channel

Can I get the sql query after calling exp:channel. I want to see the query behind an exp:channel call? Is this possible by any debugging process? Thanks
1
vote
1answer
81 views

Bulk Entry Time Change

I've just switched my localization settings for the Daylight Savings folderol. (Something that, admittedly, I haven't done in previous years.) This year, I have over 200 entries in the queue that had ...
1
vote
1answer
436 views

Order entries by value in Matrix field column

How would I go about setting the order of entries in a "products" channel based on the value in a price within a matrix field? So for each product, there is a matrix field with columns of regular ...
0
votes
1answer
119 views

EXP template inside another EXP template dosent work

I have install a plugin to get channels. And that was i have used in template {exp:getchannels} {channel_name} {/exp:getchannels} From this I got the result i.e. list of channels. thats ok. working ...
1
vote
1answer
250 views

SQL select query almost works, except for the ORDER BY

I've got a query that very nearly works, except for the ORDER BY part. In Plain English, I'm selecting the author_ids for authors who've posted entries to a particular channel, and limiting it by a ...
2
votes
2answers
291 views

expression engine super search module : group by issue

I am using supersearch module, here is link for doc of its http://www.solspace.com/docs/super_search. Actually I am facing a problem that is to get records group by. Using this module i dont know how ...
1
vote
2answers
3k views

SQL SELECT using custom field name (not ID) in WHERE

Forgive me if I missing something obvious, but I have a need to select channel entries from the EE database, but I want to select those entries based on a value assigned to one of my channels custom ...
1
vote
1answer
672 views

Getting a file directory tag {filedir_1} out of a query module result

I'm using a query module to get the results of a channel entry. I've retrieved the correct url: {filedir_1}/newimages/img1.png but it does not replace the {filedir_1} with the necessary prefix like ...
1
vote
1answer
116 views

How to get {channel_short_name} from Solspace Rating {exp:rating:entries}?

I'm using Solspace Rating to let users rate and review entries. I have many different channels and each channel has their own rating sub-category names saved as global variables. For example, for the ...
0
votes
1answer
209 views

How do I use DB SELECT to return only CHOSEN categories in a specific group while in an entries tag?

I am working in a channel entries tag. I want to return an array of category names that are selected in the entry, if they are in group_id 4. This is what I have so far... however, it is returning ...
0
votes
1answer
218 views

Where in the database do I find channel_short_name

I'm trying to write a custom SQL query like this: {exp:query sql=" SELECT channel_short_name FROM what_table_is_it_in WHERE entry_id = '{embed:entry_id}'" } {channel_short_name} {/exp:...
2
votes
1answer
154 views

Wrapping a query in a logic statement

I didn't think this would give me any trouble, but it is. I just want to run a query depending on the URL segments. I have this now: {if segment_3 != ''} {exp:query sql="SELECT a....
1
vote
1answer
268 views

SQL query syntax incorrect?

This doesn't give me an error, but it also doesn't display any results. I'm trying to display only the entries that don't have a relationship. My relationship field is field_id_57, and I only want ...
1
vote
1answer
147 views

Building a list of entries from a single category with exp:query

I'm trying to speed my site up with a few direct queries. Like: {exp:query sql="SELECT field_id_16 FROM exp_channel_data WHERE channel_id='4' "} {field_id_16} {/exp:query} What query will ...
0
votes
1answer
2k views

SQL query getting entries from current day

I am trying to use this script that I have put together, forgive me I am a bit of a newbie with sql. When I run the script it is outputting an empty csv file, only showing column titles, no data. ...
2
votes
2answers
189 views

Query tags and setting up expressionengine to read from 2 databases

I know I can assign 2 databases through codeigniter. Is there a way to tell the query tags which database to pull the information from? I'm having to pull data from an external database.
0
votes
1answer
130 views

How do I show how many members are in a member group?

I am creating a summary page that shows the number of members in each member group. I tried the following but it only displays 1 as the result and there are 25 members in this group: {exp:query sql=...
0
votes
1answer
141 views

Limiting query module results by member group_id

I am trying to limit the following query by the member's group id, but having some difficulty with the join statement. This query works fine: {exp:query sql="SELECT count(*) as member_count, ...
4
votes
1answer
817 views

Low Search Category Query on Results Page

I can not seem to find anything regarding listing what categories were selected in the search query on the results page for Low Search. Here's an example of my code on the search page: ...
1
vote
2answers
101 views

How to highlight 10 most recent entries from a channel?

I'm trying to find a way to highlight the 10 most recent entries within an alphabetically sorted list of entries from a particular channel. I don't wish to change the order of the entries, just have ...
0
votes
1answer
856 views

exp:query - how to

I'm generating a large XML document daily which on busy days is falling over with memory issues and it's been suggested that instead of using exp:channel:entries I use exp:query tags. So I think, ...
0
votes
2answers
215 views

Help with a query in channel images

I am using the following query to check if an entry in the channel images table has any categories marked 'private'. {exp:query sql="SELECT * FROM exp_channel_images WHERE entry_id = '{entry_id}' ...
1
vote
2answers
630 views

Embed variables in the Query Module for expressionengine

Having an issue with the following sql within the query module. SELECT exp_channel_titles.entry_id, exp_channel_titles.title, exp_channel_titles.url_title, exp_channel_titles.status, ...
2
votes
1answer
446 views

sql subquery channel entry & matrix rows

I need to export channel entries with matrix data and having problems joining the entry id with my matrix subquery This is the matrix subquery which adds up my rows: SELECT exp_matrix_data.entry_id, ...
2
votes
1answer
227 views

Pagination using the Query Module or Active Record Plugin

I have a custom table exp_jobs which I am querying. I have used {exp:query} and have also been trying out http://devot-ee.com/add-ons/activerecord ... Having 1 issue which I think could be solved a ...
2
votes
2answers
2k views

Writing update queries more efficiently in EE

I've got two queries that I'm running separately in a template, one after the other, like this: <?php $sql = "UPDATE exp_channel_titles SET status = 'Registered' WHERE channel_id = '12' AND ...
1
vote
1answer
120 views

Running a query within a class method

So i'm looking at http://ellislab.com/expressionengine/user-guide/development/usage/database.html I've used $query = $this->EE->db->query("SELECT channel_name FROM exp_channels"); many ...
0
votes
2answers
112 views

Need a query to display limited subset of categories based on custom category field value

I suspect there's a simple query to be able to do this but it's not something I've tried before. I'm trying to create a user-friendly way for a client to, from within the category edit screen, to ...
0
votes
1answer
110 views

How would one output a Assets File stored on Amazon S3, within a Query tag?

I have a Query tag to output Matrix data for various entries. One of the Matrix fields is an Assets field, which is linked to files stored on Amazon S3. Within the Assets database, this fields data ...
2
votes
3answers
1k views

Passing ID’s from a query to Channel Entries

I'm using quite a complex query using exp:query to generate the member ID's of members who have certain data in a custom field. I'm struggling on how to pass the generated ID's onto a channel entries ...
1
vote
1answer
110 views

Can I use a 'Select' Statement in my EE 2.5 template

I am trying to use a SELECT statement to call in some information. CODE: $qry = $this->EE->db->query('SELECT col_id_1, col_id_2, col_id_3 FROM exp_matrix_data'); I get this error when I try to use ...
0
votes
1answer
382 views

Query module: lost connection to MySQL server during query

I have a query being compiled in a template but by the time it's run, it appears that the query module has lost it's connection to the DB: Error Number: 2013 Lost connection to MySQL server during ...