I'm a noob when it comes to SQL or PHP and I'm a creating a rather simple car-sharing web site. The user can engage a trip someone created and can himself create a trip. Now I'm currently designing the SQL model, and I came across some doubts that maybe someone can help me with.
I want to save the user that created a given trip. That's easy, the tables "Trips" and "Users" have to be related, and the table "Trips" has the foreign key of "User" table, containing the user's ID that's related to a given trip.
The thing is, I wanted the user to log in and be given the chance to see: a) the trips he's engaged with; b) the trips he created. So, how can I separate data in order to have not only access to the user that created the trip, but also to users that are engaged in that trip (so that I can use all the info in the site)? What's the best way to arrange this efficiently in a SQL model, to save both the user that created the trip and the users that engaged it.