im doing a quite simple database in which i need to connect people as friends.
In my first column i have user_id and in the second one i have friend_id. What i want to achieve is to prevent a duplicate entry.
for example i want to have something like this:
user_id ; friend_id
1 ; 2
1 ; 3
1 ; 4
and so on
and prevent this:
1 ; 2
1 ; 3
1 ; 3
1 ; 4
1 ; 4
iv tried everything. If i set user_id as primary or unique, it wont allow me 2 entries with user_id = 1;
any help? thanks