AndyB
Well-known member
In a template I have the following foreach loop which uses a multidimensional array called $results.
The following code does not work:
Normally there's only one username column and I could use $result which would contain a user_id in the array.
But in this case I can't use user_id, I need to use seller_id and buyer_id so I can distinguish between two usernames.
How can I have two username links in one row?
Thank you.
The following code does not work:
Code:
<xf:foreach loop="$results" value="$result">
<xf:datarow rowclass="dataList-row--noHover">
<xf:cell href="{{ link('members', $result.seller_id) }}">{$result.seller_name}</xf:cell>
<xf:cell href="{{ link('members', $result.buyer_id) }}">{$result.buyer_name}</xf:cell>
</xf:datarow>
</xf:foreach>
Normally there's only one username column and I could use $result which would contain a user_id in the array.
Code:
<xf:foreach loop="$results" value="$result">
<xf:datarow rowclass="dataList-row--noHover">
<xf:cell href="{{ link('members', $result) }}">{$result.seller_name}</xf:cell>
</xf:datarow>
</xf:foreach>
But in this case I can't use user_id, I need to use seller_id and buyer_id so I can distinguish between two usernames.
How can I have two username links in one row?
Thank you.
Last edited: