- The query uses a LEFT JOIN in case sender is not a valid uid,
- If the sender is not found, then the template does not fill in his name in the output table.
$res = XDB::iterator(
"SELECT r.*, a.alias
FROM register_marketing AS r
- INNER JOIN aliases AS a ON (r.sender=a.id AND a.type = 'a_vie')
+ LEFT JOIN aliases AS a ON (r.sender=a.id AND a.type = 'a_vie')
WHERE uid={?}
ORDER BY date", $uid);
$page->assign('addr', $res);
{iterate from=$addr item=a}
<tr class="{cycle values='impair,pair'}">
<td>{$a.email}</td>
- <td><a href="profile/{$a.alias}" class="popup2">{$a.alias}</a> {if $a.type eq user}(*){/if}</td>
+ <td>{if $a.alias}<a href="profile/{$a.alias}" class="popup2">{$a.alias}</a> {if $a.type eq user}(*){/if}{/if}</td>
<td>{$a.date|date_format|default:'-'}</td>
<td>{$a.last|date_format|default:'-'}</td>
<td class='center'>{$a.nb|default:"-"}</td>