I am having trouble getting a query to work, and wondered if someone can help me with it.
I have two channels; Movies and Models. The Movies channel has a custom field called Models, which is a multi-select menu allowing you to choose from a list of models.
On the Movies channel I want to display which models feature in the movie, as selected from the multi-select menu. So I did this:
{exp:query sql="SELECT * FROM exp_channel_fields WHERE group_id='2' AND model_site_name='{models}'"}
{model_site_name}
{if no_results}No models in this movie.{/if}
{/exp:query}group_id 2 is the Models channel fields group, model_site_name is a field within that group and {models} is the list of models selected from the multi-select menu in the Movies channel.
But this just breaks my template and nothing shows. What is wrong?