SELECT tour_photo.*, tour.name FROM tour_photo INNER JOIN tour on tour_photo.tour_id=tour.id WHERE tour_photo.id=5 AND tour_photo.tour_id=1 query failed...