Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/02/2012, 14:41
Avatar de repara2
repara2
 
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: Consulta else if

Las llaves no coinciden:

Código PHP:
Ver original
  1. <?php
  2. $usuario = $_COOKIE['loggedin'];
  3. if (!isset($_COOKIE['loggedin'])) die("<center><img src='images/error.png'><br><div id='miclase'>No te has identificado, <a href=index.html>click ac&aacute;</a> para iniciar sesi&oacute;n.</center>");
  4.  
  5. include ("config.php");
  6. mysql_connect($server, $db_user, $db_pass) or die (mysql_error());
  7. $result = mysql_db_query($database, "select * from $table WHERE usuario = '$usuario'") or die (mysql_error());
  8. while ($qry = mysql_fetch_array($result)) {
  9.     echo "Usuario: <input type='text'  name='matricula' size='8' readonly value='$usuario'>&nbsp;&nbsp;&nbsp;";
  10.     echo "Fecha &nbsp;&nbsp;&nbsp;";
  11.     $fecha = date('d/m/y');
  12.     echo $fecha;
  13.     echo "<br><br>";
  14.      
  15.     $conexion = mysql_connect("localhost", "root", "ene2012");
  16.     mysql_select_db("usuarios", $conexion);
  17.     $queEmp = "SELECT * FROM notas_cues";
  18.     $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
  19.     $totEmp = mysql_num_rows($resEmp);
  20.      
  21.     if ($totEmp> 0) {
  22.         while ($rowEmp = mysql_fetch_assoc($resEmp)) {
  23.             $not = $rowEmp['nota'];
  24.             $user = $rowEmp['usuario'];
  25.             $fech = $rowEmp['fecha'];
  26.              
  27.             if ($user == $usuario  && $fech == $fecha){
  28.                 echo "Ya Te Evaluaste Hoy tu nota es $not <br><br>";
  29.                 echo "<a href='form.php'>Volver</a>";
  30.             }
  31.         }
  32.     }//if ($totEmp> 0) {
  33.     else{
  34.                 echo "error";
  35.             }
  36. }
  37. ?>
__________________
Fere libenter homines, id quod volunt, credunt.