The query tag has no wiki summary.
1
vote
1answer
38 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
15 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 ...
2
votes
2answers
34 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
1answer
24 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 ...
8
votes
4answers
233 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
1answer
26 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
1answer
44 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 ...
2
votes
1answer
18 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
1answer
47 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
1answer
34 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
1answer
47 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
1answer
43 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
1answer
36 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( ...
2
votes
1answer
53 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
1answer
31 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
1answer
62 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
2answers
36 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 ...
4
votes
2answers
123 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`, ...
4
votes
2answers
77 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.
...
9
votes
2answers
126 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 ...