Ver Mensaje Individual
  #16 (permalink)  
Antiguo 10/06/2014, 09:38
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: Recuperar consulta y aplicar variables, después

Prueba rápida:

Código PHP:
$expresion 'Algo"';

eval(
"\$str = \"$expresion\";"); 

echo 
$str
Genera un parse error, y un notice (puesto que $str no se define), así, a bote pronto.

Y eso que solo ha sido una prueba!

Tampoco sabes 100% seguro si los datos de la bbdd son fiables o no, si están bien escapados o no, si incluyen caracteres que provoquen una salida inesperada....

Y, por cierto, segun el manual:
Código:
aution
The eval() language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged. If you have carefully verified that there is no other option than to use this construct, pay special attention not to pass any user provided data into it without properly validating it beforehand.
__________________
>> Eleazan's Source
>> @Eleazan