I write social. network in PHP and MySQL. Made a table with likes fields id , profile_id , partner_id , date , read .
Now you need to pull out all the users that I liked and they liked me. That is mutual huskies.
So far, I have 2 arrays stretched: an array of users I liked, and an array of users who liked me. And then in the loop I check by the method of sorting whether the likes are mutual.
How to optimize it?