Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/02/2011, 19:34
Avatar de lair
lair
 
Fecha de Ingreso: enero-2009
Ubicación: header('Location: Morelia");
Mensajes: 1.052
Antigüedad: 15 años, 4 meses
Puntos: 46
Respuesta: ayuda exportar archivo csv

Hola.

Despues de tu codigo coloca:
Código PHP:
Ver original
  1. $result = mysql_query("SELECT * FROM reserva",$link)or die (mysql_error());
  2.  
  3. $f = fopen("reporte.csv","w");
  4. $sep = ","; //separador
  5.  
  6. while($reg = mysql_fetch_array($datos) ) {
  7.  
  8. $linea = $reg['id'].$sep.$reg['nombre'].$sep.$reg['email']."\n";
  9. fwrite($f,$linea);
  10.  
  11. }
  12.  
  13. //SOLO AGREGA ESTO
  14. header("Location: reporte.csv");

Suerte.