Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/02/2012, 09:58
danielmeza
 
Fecha de Ingreso: febrero-2012
Mensajes: 24
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: Problema Reporte

tienes toda la razon, esto me deuestra que me hace falta leerme todo el manual de comandos y detalles SQL. que barbaro,

bueno ya lo resolvi pero ahora tengo otro error,

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/otra.php on line 39

Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/otra.php on line 53

asi quedo el codigo.

Código PHP:
<?php
//Exportar datos de php a Excel
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=Reportes.xls");
?>
<HTML LANG="es">
<TITLE>::. Exportacion de Datos .::</TITLE>
</head>
<body>
<?php
$NombreBD 
"Prueba";
$Servidor "localhost";
$Usuario "Prueba";
$Password ="";
$IdConexion mysql_connect($Servidor$Usuario$Password);
mysql_select_db($NombreBD$IdConexion);

$sql "SELECT C001PATEN, C001ADUSEC, C001REFPED, C001NUMPED, C001TIPOPE, D001FECEXT, D001FECREM, C001ADUSE, D001FECCAM, F001VALSEG FROM AT001 Where C001NUMPED=2000003";
$result=mysql_query($sql,$IdConexion);

?>

<TABLE BORDER=1 align="center" CELLPADDING=1 CELLSPACING=1>
<TR>
<TD>PATENTE</TD>
<TD>ADUANA</TD>
<TD>REFERENCIA</TD>
<TD>PEDIMENTO</TD>
<TD>TIPO OPERACION</TD>
<TD>FECHA 1</TD>
<TD>FECHA 2</TD>
<TD>ADUSE</TD>
<TD>FECHA 3</TD>
<TD>VALOR</TD>
</TR>
<?php
while($row mysql_fetch_array($result)) {
printf("
"
.$row["C001PATEN"]."
"
.$row["C001ADUSEC"]."
"
.$row["C001REFPED"]."
"
.$row["C001NUMPED"]."
"
.$row["C001TIPOPE"]."
"
.$row["D001FECEXT"]."
"
.$row["D001FECREM"]."
"
.$row["C001ADUSE"]."
"
.$row["D001FECCAM"]."
"
.$row["F001VALSEG"]."
"
);
}
mysql_free_result($result);
mysql_close($IdConexion); //Cierras la Conexión
?>
</table>
</body>
</html>
ahora si ya copie la consulta SQL en PHPMYADMIN y me asegure de copiarla bien y volverla a comparar con la que tengo aquí en el codigo y esta correcta, ahora me dice que el error esta en el array, me podrian ayudar,

Gracias.!