$consulta = mysql_query($sql,$conexion); $respuesta = mysql_fetch_array($consulta); header ("Content-type: image/jpeg"); echo file_get_contents("$ruta/".$respuesta["url"]);