We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: charlie-imac at Jul 01, 2008, 01:25 PM

    First time using the api. I’m using the api with a select to find the site name from the system setting table. My code is returning Resource id #4. When I browse the database and table in phpMyAdmin I see the correct value. What am I missing? I’ve even tried just php and no api and get the same result.
    This is a mysql result set, i.e. Resource. You need to use the appropriate functions to get a row from this result set and you can use it as an array. See $modx->db->getRow() for more information.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      When I get values like that and am not sure what exactly they contain, this bit always comes in handy:
      echo "<pre>";
      print_r($result);
      echo "</pre>";
      

      Makes a nice listing of whatever is in that result set, be it array or object.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4966
        • 143 Posts
        Thanks, getrow was the solution.