I have two tables in my database. One table contains information about users, while the other contains data about reservations. When a user makes a reservation the userid will be placed in the reservation table. Now I would like to show a photo of the user who has made that reservation, along with the remarks and date of the reservation, but the photo is in the users table.
Here are my two tables:
I hope I didn't make any syntax errors in my query but here you go:
SELECT * FROM `users` LEFT JOIN `reservations` ON (`users`.`userID` = `reservations`.`userID`) WHERE users.userID = [userID here]