I need help to write an SQL but i have no idea in this case how.
Tried many different options but nonthing worked.
I have 2 tables in my mysql database
users (id, name, lastname)
blocked_users (id, user_id, blocked_id)
id name lastname
1 nick james
2 james dean
3 mike bendon
id user_id blocked_id
1 2 1
2 2 3
Not sure of how to run that with php, but I think this SQL should do what you asked:
SELECT * FROM users WHERE id NOT IN (SELECT user_id FROM blocked_users WHERE blocked_id = $logged_id);
Edit after comment:
Sorry, I misread the
id column name. Should be fixed now.