[SOLVED] SQL Actions Not Working

9 years 2 months ago - 9 years 2 months ago #159457 by Robert_ITMan

Seeing as [amount] is not available in MySQL Actions you can pull the info directly from the database donations table ... try adding the following to the Activation field (CBsubs > Plan > Integrations > MySql):

UPDATE `jos_comprofiler` SET `cb_adminnotes` = '---' WHERE `id` = [user_id] AND `cb_adminnotes` IS NULL LIMIT 1;
UPDATE `jos_comprofiler` SET `cb_adminnotes`=CONCAT(' Made a donation of $ ',(SELECT `amount` FROM `jos_cbsubs_donations` WHERE `user_id` = [user_id] ORDER BY `payment_date` DESC LIMIT 1),'<br /><br />',`cb_adminnotes`) WHERE `id` = [user_id];

Notice you will need to create a 'Editor Text Area' field 'cb_adminnotes' under CB Field Management for this example to work as is.
Moderators: beatnantkrileon
Time to create page: 0.435 seconds

Facebook Twitter LinkedIn