SELECT alb.parentid, alb.id, alb.folder, alb.title, img.id, img.albumid, img.filename, img.title, ott.id, ott. objectid, tag.id, tag.name
FROM zp_albums AS alb, zp_images AS img, zp_obj_to_tag AS ott, zp_tags AS tag
WHERE ((img.albumid = alb.id) AND (ott. objectid = img.id) AND (ott.tagid = tag.id) AND (tag.name LIKE 'portfolio'))
ORDER BY alb.parentid, alb.id, img.id, ott.id, tag.id;