Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/04/2011, 03:44
murcielag56
 
Fecha de Ingreso: septiembre-2010
Mensajes: 72
Antigüedad: 13 años, 7 meses
Puntos: 0
no me hace la consulta

Tengo este formulario y la consulta, pero no me carga. No se donde está el error

<html>
<head><title> CONSULTA CITAS </title></head>
<body>
<center><h2> citas del dia </h2><hr>
<form action="cita4.php" method="post">
<p> fecha <br>

<p>dia
<input type="text" name="textfield">
</p>
<p>
<input type="submit" name="Submit" value="Enviar"></p>
</form>
</center>
</body>
</html>






<?php
$conexion=mysql_connect("localhost","root","1234") or die ('No pudo conectarse');
mysql_select_db("can1",$conexion);
$day=$_REQUEST['dia'];
$sql="SELECT nombre, hora FROM citas WHERE dia = '$day' ORDER BY hora ASC" ;
$resul=mysql_query($sql,$conexion);
echo "$sql";
if(mysql_error($conexion)!=0) {
echo"<center><h2><p>ERROR AL REALIZAR LA SENTENCIA SELECT</center>";
exit();
}
$numero=mysql_num_rows($resul);
if($numero==0) {
echo"<center><h2><p>NO EXISTE CIITAS PARA ESE DIA $day</center></p>";
exit();
}

echo"<center><h2><p> LISTADO </p>";
echo"<table width='500' border='1'>";
echo"<tr><td><p> NOMBRE </p></td>;
<td><p> HORA </p></td>";
// <td><p> EDAD </p></td>
// <td><p> EQUIPO </p></td>";

while($fila=mysql_fetch_array($resul)) {
echo"<tr><td>$fila[nombre]</td>";
echo"<td>$fila[hora]</td>";
echo"</tr>";
}
echo"</table></center>";
mysql_close($conexion);

?>