How To See Who Has Liked A Picture In Php And My Sql Database

You can achieve this by storing user likes pro picture in a separate table. The table should contain two columns – picture_id and user_id. Well, I assume, that you have a picture_id in your pictures table and that you also have a table with users, which has user_id. If not – do so.
As soon as user likes a picture, you store this relation in the table and can retrieve it afterwards. Hope, this helps.

Leave a Comment