[eluser]PhilTem[/eluser]
Have you tried getting the users and friends separately and solely loop over the results from the friends table?
Maybe you give this one a try first to see if your set up works WITHOUT the join. So to speak you might have errors in your JOIN-part.
A general query should look like this (at least I'd write it down like this)
Code:
SELECT
*
FROM
`friends`
JOIN
`users`
ON
`uers`.`user_id` = `friends`.`source_id`
JOIN
`users`
ON
`users`.`user_id` = `friends`.`target_id`
WHERE
`friends`.`target_id` = 'user_id'
OR
`friends`.`source_id` = 'user_id'
Should return an array of arrays where either 'source_id' or 'target_id' is the ID of the active user.
Adopt that query to your needs, run it in simple-query mode, if this works, make it active-record compatible. And don't forget to report back