 <p><strong>Specific Photo would be something like this:</strong></p> <pre><code>//photo_id just example $photo_id = '1'; SELECT pt.id as id, pt.photo_id as photo_id, pt.tag_id as tag_id, t.tag_title, p.photo_title, p.path FROM photos p INNER JOIN photo_tags pt ON pt.photo_id = $photo_id INNER JOIN tags t ON t.tag_id = pt.tag_id </code></pre> <p><strong>All Phosts:</strong></p> <pre><code>SELECT pt.id as id, pt.photo_id as photo_id, pt.tag_id as tag_id, t.tag_title, p.photo_title, p.path FROM photos p INNER JOIN photo_tags pt ON pt.photo_id = p.photo_id INNER JOIN tags t ON t.tag_id = pt.tag_id </code></pre>