$sql = "select varValue from Config where varName = ?";
$stmt = $modx->prepare($sql);
$result = $stmt->execute(array ($varName));
if (! $result) {
    $msg = $stmt->errorInfo();
    echo 'Error in snippet "ms-mtk-getVar". ' . $msg[2] . PHP_EOL;
}
$stmt->setFetchMode(PDO::FETCH_NUM);
while ($row = $stmt->fetch()) {
    $output = $row[0];
}
return $output;