Hi guys
Hope someone out there can give me a hand. I'm new to Modx...
Anyway. I want to count resources that has a specific tv-value. I have tried every solution in the Forums but non works.
A straight SQL query would look as following, how do I do it in Modx to get the result?
Thank's in advance!
<?php
$query = 'SELECT COUNT(value) FROM `mod_site_tmplvar_contentvalues` WHERE `value` = \stockholm\' AND `tmplvarid` =71';
$result = mysql_query ($query);
$row = mysql_fetch_array ($result, MYSQL_NUM);
$total = ''.$row[0].'';
echo $total;
?>
It will be much easier to help if we know what version of MODx are you using, Evolution or Revolution?