counting how many likes one user gives another
Two things:


Group by both user IDs
Inner join to the users' table two times, use different alias to join it with different user id

SELECT u_to.username as user_to, u_from.username as user_from, count(*) as like_count 
FROM likes
INNER JOIN users u_to on likes.user_id_to=u_to.user_id
INNER JOIN users u_from on likes.user_id_from=u_from.user_id
GROUP BY u_to.username, u_from.username
ORDER BY like_count DESC