Ver Mensaje Individual
  #9 (permalink)  
Antiguo 31/03/2012, 18:18
Avatar de ylellan
ylellan
 
Fecha de Ingreso: mayo-2010
Ubicación: en un lugar de Veracruz
Mensajes: 432
Antigüedad: 13 años, 10 meses
Puntos: 36
Respuesta: formulario para buscar en base de datos un registro

corazones, problemas con las {}, ups, perdon, asi es a mi manera

Código PHP:
<?php
if(isset($_POST['enviar']))
{
    if(!empty(
$_POST['cedula']))
    {    
        include 
"conexion.php";
        
$cedula=$_POST['cedula']; 
        
conectar();    
            
$q "SELECT * FROM alumnos WHERE ID='$cedula'"
            
$resEmp mysql_query($q) or die(mysql_error()); 
        
desconectar();
            
$totEmp mysql_num_rows($resEmp);
        if(
$totEmp>0)
        {
            while (
$rowEmp mysql_fetch_assoc($resEmp)) 
            { 
                    echo 
"Nombre: <strong>".$rowEmp['nombre']."</strong><br></br>"
                    echo 
"Apellidos:<strong>".$rowEmp['apellido']."</strong><br></br>"
                    echo 
"Nota Primer Lapso: ".$rowEmp['nota1']."<br></br>"
                    echo 
"Nota Segundo Lapso: ".$rowEmp['nota2']."<br></br>"
                    echo 
"Nota Tercer Lapso: ".$rowEmp['nota3']."<br></br>"
                    echo 
"Nota Definitiva: ".$rowEmp['nota_final']."<br></br>"
            }
        }
        else
        {
            
header("location:index.php"); 
        }
    }
    else
    {
        
header("location:index.php"); 
    }    
}
else
{
    
header("location:index.php");     
}
?>