Foros del Web » Programando para Internet » PHP »

Exportar PHP a Excel, no me muesta mis campos solo </table>

Estas en el tema de Exportar PHP a Excel, no me muesta mis campos solo </table> en el foro de PHP en Foros del Web. Hola a todos estuve revisando los Faq's de este foro y vi la opcion de exportar un archivo excel por medio de php tengo este ...
  #1 (permalink)  
Antiguo 04/02/2006, 10:54
Avatar de helthon  
Fecha de Ingreso: junio-2005
Ubicación: Lima
Mensajes: 549
Antigüedad: 18 años, 10 meses
Puntos: 7
Exportar PHP a Excel, no me muesta mis campos solo </table>

Hola a todos estuve revisando los Faq's de este foro y vi la opcion de exportar un archivo excel por medio de php

tengo este escript, me abre el archivo pero solo me muestra </table>

Haber si me dan una manito y me ayudan a ver donde es el error.

Código PHP:
<?php
require_once('conectar.php');     
$sql "SELECT * FROM `opertation` "
$result mysql_query($sql$dbh) or die (mysql_error()); 
if (
mysql_num_rows($result))
{
$shtml="<table>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='7'><h3>Pacific International Air-Cargo</h3></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='7'><h4>Exportar files for status</h4></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Customer</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Delivery Day </td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Nro Document</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Status</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Client</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Image</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Date Process</td> ";
$shtml=$shtml."</tr>";
while(
$row mysql_fetch_array($result)) 

$shtml=$shtml."<td>".$row['idclie']."</td>";
$shtml=$shtml."<td>".$row['deliveryday']."</td>";
$shtml=$shtml."<td>".$row['nrodoc']."</td>";
$shtml=$shtml."<td>".$row['status']."</td>";
$shtml=$shtml."<td>".$row['respons']."</td>";
$shtml=$shtml."<td>".$row['view']."</td>";
$shtml=$shtml."<td>".$row['dateprocess']."</td>";
$shtml=$shtml."</tr>";
}
}
$shtml="</table>";
$scarpeta="a/"//carpeta donde guardar el archivo. 
$sfile=$scarpeta."statust.xls"//ruta del archivo a generar 
$fp=fopen($sfile,"w"); 
fwrite($fp,$shtml); 
fclose($fp); 
//echo "<a href='".$sfile."' target='_blank'><img src='../../imagenes/ico/excel.jpg' width='16' height='16'></a>"; 
echo "<a href='".$sfile."' target='_blank'>Haz click aqui</a>"
?>
thank
__________________
HELTHON FUENTES
FLORERIA FLORES PERU Floresperu.com.pe
Garantizamos que cada entrega de flores será de la más alta calidad y frescura
  #2 (permalink)  
Antiguo 04/02/2006, 11:26
Avatar de maralbust  
Fecha de Ingreso: febrero-2004
Ubicación: Santiago
Mensajes: 578
Antigüedad: 20 años, 2 meses
Puntos: 0
te has fijado en algo que despues de tu = ;)

Código PHP:
$shtml="<table>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='7'><h3>Pacific International Air-Cargo</h3></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='7'><h4>Exportar files for status</h4></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Customer</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Delivery Day </td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Nro Document</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Status</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Client</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Image</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Date Process</td> ";
$shtml=$shtml."</tr>";
while(
$row mysql_fetch_array($result)) 

$shtml=$shtml."<td>".$row['idclie']."</td>";
$shtml=$shtml."<td>".$row['deliveryday']."</td>";
$shtml=$shtml."<td>".$row['nrodoc']."</td>";
$shtml=$shtml."<td>".$row['status']."</td>";
$shtml=$shtml."<td>".$row['respons']."</td>";
$shtml=$shtml."<td>".$row['view']."</td>";
$shtml=$shtml."<td>".$row['dateprocess']."</td>";
$shtml=$shtml."</tr>";
}
}
$shtml=$shtml."</table>"
al no poner ese punto faltante la variable toma el valor que le asignas en ese punto y el reto se pierde.

saludos
__________________
..:: NADA SE PIERDE SOLO SE TRANSFORMA ::..
  #3 (permalink)  
Antiguo 04/02/2006, 11:42
Avatar de helthon  
Fecha de Ingreso: junio-2005
Ubicación: Lima
Mensajes: 549
Antigüedad: 18 años, 10 meses
Puntos: 7


jajaa

Gracias maralbust
__________________
HELTHON FUENTES
FLORERIA FLORES PERU Floresperu.com.pe
Garantizamos que cada entrega de flores será de la más alta calidad y frescura
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:28.