Follow new select, with the restrictions you reported in the comments. See if you can resolve your issue.
SELECT r.*, cat.id_cat
FROM ( SELECT a.id AS id_pai,
'1 - Categoria' AS rotulo,
a.nome_atributo AS valor
FROM tb_atributo a
WHERE id_pai = 0
UNION
SELECT b.id_pai,
'2 - Atributo' AS rotulo,
b.nome_atributo AS valor
FROM tb_atributo b
WHERE b.id_pai <> 0 ) AS r
INNER JOIN tb_atr_to_cat cat ON r.id_pai = cat.id_atr
INNER JOIN (SELECT DISTINCT
a.id_pai
FROM tb_atr_to_prod p
INNER JOIN tb_atributo a ON p.id_atr = a.id) ap ON r.id_pai = ap.id_pai
WHERE cat.id_cat = 115
ORDER BY 1, 2, 3
Unfortunately I could not test in sqlfiddle. Get back to me after your tests.
PREVIOUS ANSWER
Friend, follow a solution that returns a list according to your example:
SELECT r.*
FROM ( SELECT a.id,
'1 - Categoria' AS rotulo,
a.nome_atributo AS valor
FROM tb_atributo a
WHERE id_pai = 0
UNION
SELECT b.id_pai,
'2 - Atributo' AS rotulo,
b.nome_atributo AS valor
FROM tb_atributo b
WHERE b.id_pai <> 0 ) AS r
ORDER BY 1, 2, 3
Just use the SELECT column and mount a display logic on your rotulo
page.
I hope I have helped.