Questions tagged [query]
The query tag has no usage guidance.
118 questions
2
votes
2
answers
319
views
How can I use exp:query in entries?
I'm looking for a way to use exp:query in entries. So far I haven't been able to find this. I know it's not recommended but for what I'm trying to build it's most feasible to do so. That way I'll be ...
2
votes
1
answer
112
views
List where our members come from (country)
I've been trying to make a list of where our EE members comes from (country) and later on I will plot this data in to a Google Map to make it more interesting.
For the moment I've only come up with ...
11
votes
5
answers
2k
views
Query optimization and database indexes
I noticed that there a handful of queries that ExpressionEngine runs that don't use any database indexes. An example is the query SELECT DISTINCT ee.* FROM exp_extensions ee WHERE enabled = 'y' ORDER ...
2
votes
1
answer
94
views
Adding status to a query not working
Ive been using a query to pull in the amount of posts from a given category no problem. But i now want to pull in from a given status but no matter what i try its just not working quite right.
This ...
1
vote
1
answer
83
views
What is the best way to set geolocalised variables?
I have a site that was happily outputting variables based upon a user's IP address. I was using code that looked to see if a cookie for a user's region was already set and if not, looking up the user'...
2
votes
1
answer
53
views
Extending expiry dates of certain entries?
A third party is providing an XML feed of courses for me to integrate into an existing channel, which I'm planning to use Andrew Weaver's excellent Datagrab module for. My problem is that some of ...
0
votes
1
answer
487
views
SQL Query to write member username to custom channel field
Can anyone help with the syntax to write ALL members 'Usernames' in a particular member Group to a custom_field in a channel.
Each member would have one entry each in this channel and I need to pull ...
2
votes
1
answer
332
views
Quick way to get user's signature in PHP
I'm just wondering if there is a quick way to get a user's signature using something like the session class? For example to grab the active user's email from the session class you can simply call $...
4
votes
1
answer
511
views
Use Query to change status of an entry
THE SHORT: I am looking for the sql query I need to run in order to change the status of an entry. Any help would be appreciated.
THE LONG: I have two sperate channels and they are NOT linked via a ...
2
votes
1
answer
399
views
Pagination issue with Query and Conditional Statement
I have a script that uses query to determine if a particular entry is open or closed. based on that entry, it then displays a list of blog entry excerpts. if that particular entry id has a status of ...
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/...
2
votes
1
answer
98
views
Show a combined Solspace User and native Member entry count?
I have an existing DB with entries that have been assigned to authors via the native Members module as well as Solspace's User module.
Unfortunately, the User module doesn't take into account entries ...
3
votes
1
answer
269
views
QUERY join for members that have entries
I'm trying to learn how to do mysql joins. Twitter has helped already get me started.
I'm trying to find the number of members that have entries attached to them...
Then the number of members that ...
1
vote
1
answer
250
views
Channel Entries: DISTINCT and COUNT
Given Channel entries, is there a way to get a list of unique entries in a text field and how many times that entry exist? For example, say the Channel contains the field first_name (FT is text) and ...
4
votes
2
answers
192
views
issue with fixed_order and embed query
I’m having some issues with the fixed_order parameter.
I’m running a query to order by a matrix col
{embed="_includes/_ajax_results"
entry_ids="{exp:query sql="SELECT entry_id FROM ...
5
votes
2
answers
520
views
ExpressionEngine 1 Query Module and Ordering SQL UNION
I'm receiving a MYSQL Error on this code in ExpressionEngine 1.6.4 (very old version)
{exp:query limit="10" paginate="bottom"
sql="SELECT 'gallery' AS `content_type`, `cat_id` AS `entry_id`, `...
7
votes
2
answers
1k
views
How can I use the current logged in member ID in a custom query using the query module?
I have a query that I need to do that involves using the logged in member ID to limit the results. The following does not work, because the {member_id} variable is not parsed early enough.
{exp:...
13
votes
2
answers
354
views
Custom plugins vs query tags: advantages and implementation
An answer to another question touched on the use of writing custom plugins as a more robust alternative to writing a SQL query in a template via the {exp:query} tag.
What are the advantages/pitfalls ...