I created a custom field of type query. It works just fine. However, if you go into the administration section, click the community builder menu, proceed to user management and then click the "New" button, it returns this error:
Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[user_id]' at line 1 SQL=SELECT `payment_status` FROM `abca_cbsubs_payments` WHERE `item_name` LIKE '%2014%' and `for_user_id` = [user_id]
The SQL syntax is correct and works just fine for returning the results that I am looking for in their profile. Therefore, I know that it isn't the syntax. Except that [user_id] is a CB variable, so maybe it doesn't know how to handle it when starting from scratch.
Some more information: It is a field type of Query. The SQL query is exactly as listed above.
There is no pre-filled value.
Required: NO
Show on Profile: Yes on 1 line
Display field title in profile: Yes
Searchable: No
User Read Only?: Yes
Show at Registration?: No
Published: Yes