Hot answers tagged

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....
Harsh Barach's user avatar
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"}
Bluedreamer's user avatar
  • 1,577
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 ...
jrothafer's user avatar
  • 5,900
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->...
Harsh Barach's user avatar
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:...
jrothafer's user avatar
  • 5,900
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 ...
JCOGS Design's user avatar
  • 3,587
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 ...
jrothafer's user avatar
  • 5,900
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 (> , <, >=, &...
Mufi - Amici Infotech's user avatar
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 ...
AllInOne's user avatar
  • 1,079
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 ...
Chris O'Connor's user avatar
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 ...
Michael McGhee's user avatar
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 ...
James Smith's user avatar
  • 4,885
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.
Derek Hogue's user avatar
  • 17.4k
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=' ...
Tom Perkins's user avatar
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/%...
Pontus Madsen's user avatar
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 ...
Low's user avatar
  • 11.3k
1 vote

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

The issue was that the Hosting Provider had enabled mod_security in the middle of the day (right when I had taken a slight break) without notifying me of this ahead of time. They disabled ...
L.Callif's user avatar
1 vote

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

I preface the answer by saying that I do not recommend using SQL to get at your entry data this way, as it's what the Channel Entries tag and field variables are designed to do for you. That said, ...
Derek Jones's user avatar
  • 2,255
1 vote

URL segmentation GoDaddy

I think I've heard of this issue before, where the host forces query strings. http://ee2docs.com/urls/remove_index.php.html#exceptions Look under that reference and scroll down to the area ...
jrothafer's user avatar
  • 5,900
1 vote

List authors by number of posts in specific channel

After reading up a bit on mySQL, I've found an answer, which seems to work. If anyone sees that this is horribly inefficient feel free to disagree! {exp:query sql="SELECT exp_members.screen_name, ...
Frank Harrison's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible