Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/11/2011, 13:18
rey_7217
 
Fecha de Ingreso: noviembre-2011
Mensajes: 16
Antigüedad: 12 años, 5 meses
Puntos: 0
Respuesta: Consultas a la base de datos

Se puede decir que ya "medio" funciona por que me busca a los grupos que entraron a la sala en la fecha que se introdujo, pero el problema ahora es que son todos los grupos, y yo solo quiero que me salga el grupo que se introdujo en la fecha que igual se introdujo, como se haria???

Mi codigo:

Código PHP:
<?php
require("conexion.php");
require(
"funciones.php");

$criterio getParam($_GET["criterio"], "");
$Grupo=$_POST['Grupo']; 
$total 0;
if (
$criterio != "") {
    
$query "SELECT Fecha, Grupo from asignar WHERE Fecha like '%{$_GET['criterio']}%' OR Grupo='%{$_GET['Grupo']}%'";
    
$queEmp mysql_query($query$conexion);
    
$total mysql_num_rows($queEmp);
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Consultar grupos</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {font-size: 18px}
-->
</style>
</head>
<body>
<h3>Buscador de Grupos: </h3>
<p class="Estilo1">  Fecha</p>
<form id="frbuscar" name="frbuscar" method="get" action="">
    <p>
      <input name="criterio" type="text" id="criterio" size="25" value="<?php echo $criterio?>" />
    </p>
    <p>
      <label>
      <input type="text" name="Grupo" id="Grupo" />
      </label> 
    </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 ?>
</table>
<p>
  <?php ?>
</p>


<p>&nbsp;</p>
</body>
</html>
por favor que me ayuden, lo necesito!!!
Gracias!!!