<html>
<head><title>Reporte</title></head>
<body>
<h3>Reporte</h3>
<form name="form1" method="GET" action="reporte.php">
<p>Fecha<br />
<input type="text" name="busqueda" id="busqueda" />
</p>
<input type="submit" id="btnbuscar" value="Reporte"/>
<?php
if ($_REQUEST["busqueda"]!=""&& $_REQUEST["busqueda"]!="")
{
if (is_numeric($_REQUEST["busqueda"]))
{
echo $filtro="numero ". $_REQUEST["busqueda"];
}
else
{
echo $filtro="fecha ('%".$_REQUEST["busqueda"]."%')";
}
} else {
echo "No hay escrito en el cuadro de texto";
}
//Conexion con la base
$conectar=mysql_connect("localhost","root","mysql" );
//selección de la base de datos con la que vamos a trabajar
mysql_select_db("percy");
//Ejecutamos la sentencia SQL
$result=mysql_query("select * from usuarios WHERE fecha like '%".$filtro."%'");
?>
<table align="center">
<tr>
<th>Fecha</th>
<th> Inscritos</th>
<th> Egresados</th>
</tr>
<?php
//Mostramos los registros
while ($row=mysql_fetch_array($result))
{
echo '<tr><td>'.$row["fecha"].'</td>';
echo '<td> &nb sp;'.$row["altas"].'</td>';
echo '<td> &nb sp; '.$row["bajas"].'</td>';
}
mysql_free_result($result)
?>
</table>
</body>
</html>
</body>
</html>
Despues de eso quisiera ver la forma de implementarlo de manera que tubiera 2 campos de texto y asi poner fecha de inicio y fecha final para hacer un reporte de periodo, pero eso ya es harina de otro costal, por lo pronto quiero poder representar el reporte diario, ya puedo exportar a excel pero me exporta todos los registros , asi que me gustaria saber que tengo mal para poder mostrar un solo registro y asi exportarlo
de antemano gracias
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)