0

I'm tying to improve my sql. I have 3 tabels called users, posts and blocked. If one user block another user it will add to blocked table from(blocker id) to(blocked id). Then it doesn't show this users posts to each other. I made it with 2 steps. Firsts looks to blocked users table with Select * from 'blocked' where from = :my_id OR to = :my_id. I save all ids in array. Then if i will take posts, i'm using Select * from posts where poster_id NOT IN (array). This method works. But i think it will slover if i block more than 1000 people. Any idea how can i do with one sql?

0 Answers0