I was trying to find a way to pass variables to queries using an @SELECT binding and could not. I took a look at the current code for @SELECT and wondered if we could change the {DBASE} and {PREFIX} tags to placeholder style, and then execute the mergePlaceholderContent on the param. What do you think?
case "@SELECT": // selects a record from the cms database
$rt = array();
$replacementVars= array(
'DBASE'=> $modx->db->config['dbase'],
'TABLE_PREFIX'=> $modx->db->config['table_prefix']
);
foreach($replacementVars as $key=> $value) {
$modx->setPlaceholder($key, $value);
}
$param = $modx->mergePlaceholderContent($param);
$rs = $modx->db->query("SELECT $param;");
$output = $rs;
break;