We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26310
    • 130 Posts
    When querying a DB using the modx syntax, how do you assign a variable from the results. My code is:

    	$res = $modx->db->select("zip", $table_prefix."web_users_attributes", 
    	"internalKel='$uid'");
       if($modx->db->getRecordCount($res))
       {
          //set placeholders for user info
    
    	  $modx->setPlaceholder("zip", $zip);
       }

    How do I assign $zip?

    Did some refining on my Googling and came across this page:
    http://wiki.modxcms.com/index.php/DB_query_and_Placeholders

    Works like a charm smiley
      I twitch because I care....and drink too much coffee.