EDITED by author: I accidently put member_group in the example. It is now member_id.
I am trying to create an un-ordered list based on an SQL query:
{exp:query sql="SELECT CONCAT(m_field_id_10,'|',m_field_id_11,'|',m_field_id_12) as chapters FROM exp_member_data as d WHERE d.member_id='{member_id}'"}
{exp:weblog:entries weblog="crew_chapter" entry_id="{chapters}"}
<li>{title}</li>
{/exp:weblog:entries}
{/exp:query}
The above sql query works perfectly from the MySQL CLI if I substitute {member_id} with my actual member ID which is 1442, with these results:
+----------+
| chapters |
+----------+
| 16|17|18 |
+----------+The next step I took was to modify the SQL query so that instead of {member_id} I hard-coded my actual member id, and bingo, it worked! Except I need the output based on the currently logged in user, not always on me 😊
I know that {member_id} alone as a variable works fine, as I tested by putting just that tag in my template, and it output my member id 1442.
So, how can I get the current member_id into the sql query above?