Answer the question
In order to leave comments, you need to log in
How not to repeat entries with the same foreign_id?
user_cars(id, user_id, car_id, expired_at). Table for car rental.
It could be that one user rented the same car several times. I would like to get data on how many times the car has ended up being rented out. I don't know how to correctly implement a user_id repetition check... I can use foreach, but I want to read your version. Thank you!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question