This old embarrassing code worked in 2.0.0, but doesn’t any more. If there’s no quick fix, I’ll try to make a schema and convert it to xPDO, but I thought I’d ask first.
<?php
$rows= array();
$stmt = $modx->query("SELECT DISTINCT modx_quotations.topic FROM `modx_quotations` order by modx_quotations.topic ASC");
if ($stmt) {
$rows = $stmt->fetchAll(PDO_FETCH_COLUMN, 0);
} else {
$output .= "query failed";
}
$count = count($rows);
$i=0;
while ($i < $count) {
$first = $rows[$i];
$output = '<INPUT TYPE="RADIO" NAME="topic" VALUE="'.$first.'">';
echo $output;
$i++;
}
[Update] - Mostly just a matter of changing the PDO constants and tweaking the query string:
PDO_FETCH_COLUMN -> PDO::FETCH_COLUMN