Just wondering if I'm missing something here:
$sql = "SELECT DISTINCT usr.id,
CONCAT(usr.username, '".PHP_EOL."' ) as username
FROM #__ads AS a
RIGHT JOIN #__users
WHERE gid= '19' AS usr
ON usr.id = a.userid
ORDER BY usr.username";
It works when I remove the WHERE gid = '19' part, is it in the wrong place? The gid column only exists in the __users table.
Thank you!
Edit: got it, just needed to put the Where clause right before the ORDER BY.