I am using this line of SQL code:
SELECT DISTINCT tb_online.ip, tb_users.id, tb_online.login, tb_online.page
FROM tb_online
JOIN tb_users
ON tb_online.login=tb_users.username
ORDER BY login ASC
The problem is that this line ON tb_online.login=tb_users.username
means that SQL query only selects users but not guests (they don't have username in the tb_users
table).
How could I make SQL query to select both users and guests?