We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    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
      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting