Me da el siguiente error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') as sbc WHERE sbc.imagen='img/puentemaua2.jpg'' at line 17
lo que hice:
Código PHP:
Ver original$orden="SELECT sbc.imagen,sbc.tabla FROM (SELECT g.imagen as imagen, 'g' as tabla FROM imagenesgaleria g
UNION ALL
SELECT p.imagen as imagen, 'p' as tabla
FROM fondopagina p
UNION ALL
SELECT gi.imagen as imagen, 'gi' as tabla
FROM galeriainicio p
UNION ALL
SELECT i.imagen as imagen, 'i' as tabla
FROM imagenes i
UNION ALL
SELECT fi.imagen as imagen, 'fi' as tabla
FROM fondoinicio fi
UNION ALL
) as sbc
WHERE sbc.imagen='$imagen'";
Gracias por la respuesta!