I'm struggling with the correct SQL to use in a custom field.
In my set up we have the Community Builder (CB) integration enabled. In the users CB profile we have added fields where they record their children's names (our site is for booking nursery places).
So in the comprofiler table there are the fields cb_child1, cb_child2 etc.
I am looking to have a field on the Event Booking registration form where the [logged in] user picks from a drop down list, the name of the child that they are booking a session (event) for.
So far I have the following
This query works fine in phpmyadmin and returns two columns of values.
However when I put this code in the custom field 'Default Value', on the registration form you get an empty list.
I'm also not sure how you would pass the logged in users' user id to the query.
A steer in the right direction would be appreciated.