Ver Mensaje Individual
  #17 (permalink)  
Antiguo 11/10/2007, 10:22
Avatar de capuleto
capuleto
 
Fecha de Ingreso: octubre-2003
Ubicación: Cartagena
Mensajes: 219
Antigüedad: 20 años, 6 meses
Puntos: 0
Re: Generar Archivo Plano

este es el codigo que estoy usando actualmente..
Código PHP:
<? 
$conn 
mysql_pconnect("localhost","root",""); 
mysql_select_db("planos"$conn); 
$query "SELECT * FROM `informacion`"
$resultado mysql_query($query); 
while (
$registro mysql_fetch_array($resultado)) { 
$cod str_pad($registro['cod_acudiente'], 16"0"STR_PAD_LEFT); 
$valor1 $registro['nro_cuenta'].$registro['nom_colegio'].$registro['nom_cliente'].$cod."\n"
$valorarchivo .= $valor1

$f1 fopen("SEARF001","w+"); 
fwrite($f1,$valorarchivo); 
mysql_close($conn); 
fclose($f1); 
$nombre_arch "SEARF001";
header ('Content-Disposition: attachment; filename="'.$nombre_arch.'"');
header ("Content-Type: application/");
readfile($nombre_arch);
header ("Content-Length: ".strlen($res->archivo));
exit;
?>
Me podrias ubicar la respuesta anterior..
__________________
...Definitivamente Soy Nadie entre los Sabios....*-*Capuleto*-*