BACKGROUND
Some profiles are people; some profiles are locations.
'People' work at 'locations'
Using CB Connections, People connect to Locations and designate a connection type of "Works At"
I want to show a line in people's profiles ...
'Fred' -- 'works at' -- 'Factory A'
Loged in User -- Connection Type -- A Different User ID's Name
After reading through the tutorials from Kyle's signature, I learnt about Substitutions
The logged in user Fred [cb:userdata field="username" user="#me" /] works at [cb:userdata field="name" user="99" /].
Where 99 is Factory A.... I just have to make that user="99" 'dynamic'
Next I read about CB Query Fields, so after much fiddling in mysqladmin, I came up with this (I am very new to SQL)
SELECT memberid
FROM `mydb_comprofiler_members`
WHERE `type` = 'Works at'
AND `referenceid` = '[user_id]'
This gave me the id number of the target location. I tested it as
Works At = [cb:userdata field="cb_worksat" /]
logged on as different users, and the number changed appropriately.
For the last step, I tried
The logged in user Fred [cb:userdata field="username" user="#me" /] works at [cb:userdata field="name" user="cb_worksat" /].
But this did not work. A blank was displayed.
I guess that cb_worksat is not resolving to a number??
I played around some more with syntax guessing but wih no luck... Sorry for the long description, but I have tried to get as far as I can by myself.
But if someone could help me along the rest of the way, that would be much appreciated.