Hello, I’m converting (struggling more like it) some scripts to work in REV that will output a json feed that will be read by mootools to display a list of items and I need to find out how to convert this from EVO.
$countRows = $modx->db->select("COUNT(DISTINCT alias)", " modx_games_ext");
$r = mysql_fetch_row($countRows);
$numrows = $r[0];
The reason why I need this is to allow for a pagination option with the json/mootools list. It all works just nicely in EVO but I can’t quite get the COUNT(DISTINCT alias) to work with PDO.
I tried which didn’t work.
$nRows = $modx->query('SELECT COUNT(DISTINCT alias) FROM modx_ext')->fetchColumn();
echo count($nRows);
EDIT***
I have worked on the script a little more and I have it working now. Not sure if it’s exactly to the modx standard but it’s working... a nice ajax/mootools pagination list being fed via json/modx = sweet tamales