Hey,
I needed to change the Personalize snippet. The personalize snippet currently uses a get method (getLoginUserName) to get the username and returns it appended to a custom message if desired.
I wanted to get the fullname field from the database...so what I thought to do was:
$o = ’ ’;
$person = $modx->getLoginUserID(); #This returns the userid which is the foreign key from the web_user_attributes
#Then make a call to the database:
$sql = "SELECT fullname FROM ".$modx->getFullTableName("web_user_attributes")." WHERE internalKey=’$person’";
$o = ($sql)? "$message$sql" : ’’; #set it into my variable o
return $o; #return it
Unfortunately, this doesn’t make a query...it simply spits out "SELECT fullname FROM...etc.
If anyone can help in how to make sql commands in a snippet, I would appreciate it
Thanks,
Josh