hi,
quite easy actually, you'll just have to play with 2 tables max, one being enough if you use tv id instead of it's name
yourprefixe_site_tmplvar_contentvalues
is the table where tv values are stored, relations are
- contentid, the ressource id
- tmplvarid the tv id
- value, well do i need to explain
then
"select contentid from yourprefixe_site_tmplvar_contentvalues where tmplvarid = '$tvid' and value='$zivalue'"
will return all the ressource ids you're looking for
now if you prefer to work with tv names, you'll just have to add a sub select to your request
where tmplvarid in (select id from yourprefixe_site_tmplvars where name='$tvname')
should do the trick (yourprefixe_site_tmplvars being the table where all yout tv's id, name, type an so on are stored)
have swing