I’m trying to get data from two MySQL tables, but having problems.
Usually, I’d use join to get data from two those tables depending on data, but this time I cannot, I think.
Here’s situation:
I’m having tables photos and photos_albums.
photos ID ALBUM FILENAME
photos_albums ID TITLE NAME
I need to get all albums and photo if exist in photos table. When I use join query will return albums only if photo with specific album id exists.
How to resolve? Any suggestions? Any help appreciated.
Regards,
Tom
Probalby you are using
INNER JOIN(or justJOIN, which is the same), this way you are given the rows that have data in both tables. Try soselect from albumsandLEFT JOINwith photos table.