re: nesting a query inside a channel entries tag issue:
Any thoughts? Stuck on this one for awhile…
{!-- First {entry_id} --}
{exp:query sql="SELECT start_date FROM exp_calendar_events WHERE entry_id = '{entry_id}'"}
{!-- Second {entry_id} --}
{start_date}
{/exp:query}When uncommenting the “first” entry_id I get a nice list. When uncommenting the “second” entry_id I get a nice list. I’ve never received the {start_date}, even when explicitly providing a entry_id. I have ran the query through the back-end to verify and get the data.
Solution- if you change it from
Select start_date FROMto
SELECT start_date as starter_date_test FROMand then use starter_date_test as a variable does it work?
It does indeed work, because start_date was conflicting with an entry variable. Giving it an alias prevented it being overwritten- something to keep in mind whenever nesting tags!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.