Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/11/2015, 12:03
kevinlopez
 
Fecha de Ingreso: noviembre-2015
Mensajes: 9
Antigüedad: 8 años, 5 meses
Puntos: 0
Problema al Realizar Reportes

Hola buenas tarde les hablo desde Perú:)
Bueno mi duda es la siguiente:
Estoy intentando generar reportes en excel, ya lo hice con otro ejemplo y si me sale pero con este no, en el otro ejemplo solo seleccione todos los datos de una tabla
En este quiero seleccionar solo datos especificos y me dice que tengo error en la linea 10 nose porque aqui les dejo mi codigo
Porfavor respondan pronto es para un trabajo de universidad, Gracias de antemano

<?php
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=Reporte Mensual.xls");
header("Pragma: no-cache");
header("Expires: 0");

$con=mysql_connect("localhost","root","");
mysql_select_db("gestion_comercial",$con);

$mes= $_POST['cbomes'];

echo 'RESULTADOS DE SU BUSQUEDA<br><br>';

if($mes==1)
{

$res=mysql_query("SELECT * FROM pedido WHERE fecha_pedido BETWEEN '20150101' AND '20150131'");

$nregistros=mysql_num_rows($res);

if($nregistros==0)
{
echo 'No se encontraron registros para esta busqueda';
}
else
{
echo '<table class="tabla">';
echo '<tr>';
echo '<td>Descripción</td>';
echo '<td>Cliente/td>';
echo '<td>Precio</td>';
echo '<td>Fecha de Pedido </td>';
echo '<td>Fecha de Entrega</td>';
echo '</tr>';
while($fila=mysql_fetch_row($res)){
echo '<tr>';
echo '<td>'.$fila[1].'</td>';
echo '<td>'.$fila[2].'</td>';
echo '<td>'.$fila[3].'</td>';
echo '<td>'.$fila[4].'</td>';
echo '<td>'.$fila[5].'</td>';
echo '</tr>';
}
echo '</table>';
}
}

El codigo sigue, pero de ahi solo cambia el else y las fechas
Porfavor Respondan!!!!!