Hi all,
i have a TV named 'year'. I want to make a dropdown with all the years that have been used in that TV.
so i need to do a DISTINCT query on the table tmplvar_contentvalues where tmplvarid=7 to retreive all possible entries.
But i haven't got a clue how to do that? and i can't find a lead in these forums (fora) as well
also because i hope to use standard Modx methods to make sure my query is sanitized /secure.
any ideas
RDG
Hi
Tnx for the reply a lot has been built and used allready so i'd rather stick to what we have now.
Also i need this in an snippet to build the dropdown of a form. so i still need to know how to do that query.
Good tip thought hadn't thought of that
Rdg
-
☆ A M B ☆
- 24,524 Posts
@SELECT is not as flexible as coding for a snippet. I'm not sure that you can use xPDO "properly" here. This should do what you want:
@SELECT DISTINCT value FROM [[+PREFIX]]site_tmplvar_contentvalues WHERE tmplvarid = 7