SELECT DISTINCT(p.products_id) from products as p
JOIN manufacturers as m ON p.marca=m.manufacturers_id
JOIN categorias as c ON c.categories_id=p.categoria
JOIN stocks as s ON s.products_id=p.products_id
WHERE s.stock>0
AND p.online=1
AND p.thumb!=''
AND p.precio_ini>0
AND p.precio_ini<10000
AND (
p.codigo='valkyrie'
OR
p.nombre LIKE '%valkyrie%'
OR
m.manufacturers_name LIKE '%valkyrie%'
OR
c.categories_name LIKE '%valkyrie%'
)