Ver Mensaje Individual
  #8 (permalink)  
Antiguo 16/12/2011, 09:27
jarjausroy
 
Fecha de Ingreso: diciembre-2011
Mensajes: 50
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Exportar consulta .csv

pero por ejemplo cuando pongo

Cita:
<?php
include "Connections/cn.php";
$table = "provincias";
$sql = "SELECT * FROM ".$table." LIMIT 0, 30";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)){
// echo $row['PROVINCIA'];
$shtml = $row ['PROVINCIA']. "\n";
// $shtml = $shtml.$row ['PROVINCIA']. "\n";
$shtml;
}
// define al archivo
$file='usuariocardiosito.csv';
if (!$file)
{
//el archivo no existe
die ("File not found");
}
else
{
//header("cache-control: public");
header("Content-Descrption: File Transfer");
header("content-disposition: attachment; filename=$file");
header("Content-Type: application/force-download");
echo "paso ok --->> ";
}
?>

se genera .csv y en la fila colum (A1) pone "paso ok --->> "
no entiendo que estoy haciendo mal para que no se exporte en .csv la consulta realizada