Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/11/2011, 09:20
rey_7217
 
Fecha de Ingreso: noviembre-2011
Mensajes: 16
Antigüedad: 12 años, 5 meses
Puntos: 0
Respuesta: COmparaciones

No lo estoy manejando con DATE o DATATIME si no con un varchar, lo que quiero es que se me muestre un determinado grupo con una determinada fecha el codigo que tengo es:

<?php
require("conexion.php");
require("funciones.php");

$criterio = getParam($_GET["criterio"], "");
$total = 0;
if ($criterio != "") {
//$query = "SELECT * FROM asignar WHERE Grupo like ".sqlValue($criterio."%", "text")." ORDER BY Grupo ASC";
$query = "SELECT Fecha from asignar WHERE Fecha like '%{$_GET['criterio']}%'";
//criterio= Grupo y palabra=Fecha
//$query = "SELECT Grupo, Fecha from asignar WHERE Grupo=`{$_GET['criterio']}` LIKE Fecha='%{$_GET['palabra']}%'";
$queEmp = mysql_query($query, $conexion);
$total = mysql_num_rows($queEmp);
}
?>

<form id="frbuscar" name="frbuscar" method="get" action="">
<p>
<input name="criterio" type="text" id="criterio" size="25" value="<?php echo $criterio; ?>" />
</p>
<p> <input type="submit" id="btbuscar" value="Buscar" /> </p>
<p>
<?php if ($total > 0) { ?>
</p>
<p>&nbsp; </p>
</form>
<p>&nbsp;</p>
<p><em>Total de Resultados: <?php echo $total; ?></em></p>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Grupo</th>
<th>Fecha</th>
</tr>
<?php while ($rsEmp = mysql_fetch_assoc($queEmp)) { ?>
<tr>
<td><?php echo $rsEmp['Grupo']; ?></td>
<td><?php echo $rsEmp['Fecha']; ?></td>

</tr>
<?php } ?>


Gracias