03-15-2016, 01:19 PM
In most cases a column named "id" is the primary key or unique identifier/selector for a row of data. So when you perform a SELECT id WHERE user_id=? that returns the unique identifier 'id' which in these cases are 100 or 101 or whatever, which matched your query WHERE condition of user_id. So every table in the row can be described the same way: a row with id=X, has user_id=Y and permission_id=Z. Again in this example the id column simply acts as a unique identifier for the useful information which demonstrates the permission_id's which have been assigned to a user_id.
In this case user_id 1 belongs to permission_id 1 and 2 so it has two entries. The actual value of id in this case is meaningless except for providing a unique identifier.
In this case user_id 1 belongs to permission_id 1 and 2 so it has two entries. The actual value of id in this case is meaningless except for providing a unique identifier.