3
votes
Accepted
How to use an SQL query to display entries from last 45 days
You can try below query to display entries of last 45 Days.
SELECT DISTINCT field_id_19 AS HomeTitle FROM exp_channel_data t1 INNER JOIN exp_channel_titles t2 ON t1.entry_id = t2.entry_id WHERE t1....
2
votes
Get all entries where expiration date is within last 12 months
Could you not use native parameters for this?
{exp:channel:entries channel="mychannel" show_expired="only" start_on="-12 months"}
2
votes
Accepted
Querying for a relationship field
https://docs.expressionengine.com/latest/fieldtypes/relationships.html#accessing-children
To access the child entry to your Servers channel, just loop over the field like so:
{exp:channel:entries ...
2
votes
Accepted
Create an entry from an extension?
Yes, obviously it is possible to use the model to create a new entry. To create a new entry using model you should follow below syntax.
$entry = ee('Model')->make('ChannelEntry');
$entry->...
1
vote
Accepted
tracking query parameter
Given your outdated EE version, I'm not sure there are any viable add-on's that can help you with this (maybe Mo' Variables if you can get an old version?).
A quick search shows this add-on:
https:...
1
vote
Accepted
Add new Channel ID access to multiple member groups via SQL Query
If you have access to a SQL Utility like Sequel Pro and a code editor it is pretty easy to do.
First you need to get a list of the groups that don't have the channel_id set.
Using the SQL Query tab ...
1
vote
Getting Channel Entry Data With AJAX
There are answers both complex and simple, really depending on your actual use case.
This simple answer is just to AJAX in a template that does what you want. There is no reason you can't have a ...
1
vote
Accepted
Model service filtering by date
$data = ee('Model')->get('ChannelEntry')->filter('field_id_103', '>' , '1536677819');
This code works for me. Where field_id_103 is my field ID and 2nd parameter is operator (> , <, >=, &...
1
vote
Accepted
Need query that filters entries by category
You have defined p as alias for the posts table but you have not defined t as alias for the titles table.
FROM exp_channel_titles t
You'll also probably want to limit by status and by date (not ...
1
vote
Accepted
SQL Query to Get count of entries of a certain status inside channel
So... I finally got it working, though not with SQL which I imagine is more efficient. Behold my mess. Note this is only because I'm having to nest it, and also match to url_title because of how we ...
1
vote
SQL Query to Get count of entries of a certain status inside channel
It might work out easier to turn this into a short plugin, but would a query like this work? You'd need to pass in the id of the channel you're looking for.
{exp:query sql="SELECT count(*) AS ...
1
vote
Accepted
Dynamic Template Name in URL
Are the separate templates really different enough to warrant being separate? Usually you could code in the logic for slightly different views within a single template - much simpler and more ...
1
vote
Accepted
Passing a GET variable back in a query while using mysqli_real_escape_string()
Use ee()->db->escape_str($event) - it's the native way to escape potentially-unsafe data in EE.
1
vote
Removing duplicate entries using an SQL query
I've now solved this one by using an SQL Query as follows:
<select id="locationList" name="fieldName">
<option value="">All Locations</option>
{exp:query sql='
...
1
vote
Removing duplicate entries using an SQL query
I would have solved that with storing everything in a exp:stash:set_list, and then looping out it with a exp:stash:get_list.
Read more on how to do that here:
https://github.com/croxton/Stash/wiki/%...
1
vote
Low Search and match 3 fields and then return data
Looking at your example code, you've got several filter parameters in your Form tag. And as stated:
these parameters can be applied in two ways: as input fields in a Form, or as hard-coded ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
query × 118sql × 21
query-module × 18
database × 16
ee2 × 11
channel-entries × 11
categories × 11
mysql × 11
relationships × 7
members × 6
channel × 5
php × 5
search × 5
custom-fields × 5
count × 5
module × 4
templates × 3
matrix × 3
stash × 3
playa × 3
ee3 × 3
add-on-development × 3
low-search × 3
grid × 3
supersearch × 3