Obiously EE is making a magic looping with the use of tags but sometimes we still want to get the previous data.
To make it clear here is an example code which is not working where I want to display the group_title ONLY once. It will display ONLY on its first occurence, Is this possible to achieve with EE?
{exp:query sql="
SELECT exp_members.member_id, exp_member_groups.group_title, exp_members.username, exp_members.screen_name, exp_members.email
FROM exp_members
INNER JOIN exp_member_groups
ON exp_members.group_id = exp_member_groups.group_id
ORDER BY exp_members.group_id
"}
{if previous_group_title != group_title} //previous group title is within the array() it is like $i-1
<tr><td colspan="3">{preload_group} - {group_title}</td></tr>
{/if}
<tr>
<td>{member_id}</td>
<td>{screen_name}</td>
<td>{email}</td>
</tr>
{/exp:query}{if previous_group_title != group_title} //previous group title is within the array() it is like $i-1
<tr><td colspan=“3”>{preload_group} - {group_title}</td></tr>
{/if}
best regards,
Jay
Moved to CodeShare Corner by Moderator