Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/03/2012, 15:40
elsaiya
 
Fecha de Ingreso: marzo-2012
Ubicación: El Vigia Edo Merida
Mensajes: 147
Antigüedad: 12 años, 1 mes
Puntos: 1
Respuesta: formulario para buscar en base de datos un registro

Utiliza este para ver si te funciona y me avisas hermano

<?php
$nombre = $_POST['nomb']; // esta es la linea 2 donde esta el error
$conexion = mysql_connect("localhost", "root", "16313024");
mysql_select_db("registro", $conexion);

$queEmp = "SELECT * FROM alumnos WHERE ID='$nombre';" or die ("Error en la consulta");
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
if (!$totEmp)
{
echo "Usted no ve Clase con este Profesor";
exit;
}
?>

<style type="text/css">
<!--
body {
font-family: "Trebuchet MS", Tahoma, Verdana;
font-size: 14px;
font-weight: normal;
color: #666666;
text-decoration: none;
padding: 20px;
}
h4 {
color: #CC0000;
}
-->
</style>
</head>
<body>
<h4 class="Estilo2">Informacion Personal</h4>
<?php
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>";

}
}
?>