Ver Mensaje Individual
  #8 (permalink)  
Antiguo 30/03/2012, 18:43
elsaiya
 
Fecha de Ingreso: marzo-2012
Ubicación: El Vigia Edo Merida
Mensajes: 147
Antigüedad: 12 años, 1 mes
Puntos: 1
Respuesta: Registras varios datos en msima tabla

Disculpame asi si me funciona me resgitra los q yo seleccione pero no me consulta si ya estan registrados para q den el aviso de error asi aquie stan los codigos donde registra todos los q selecciono

<?php
$conexion=mysql_connect("localhost","root","") or die("Problemas en la conexion");
mysql_select_db("inscripcion",$conexion) or die("Problemas en la selección de la base de datos");
$Grado=$_POST['grado'];
$Seccion=$_POST['seccion'];
if ($Grado ==Null )
{
echo "<h4><center><font color='red'><strong>Error Campo Grado vacio</strong></font color></center></h4>";
echo "<h4><center><font color='red'><strong>Por favor seleccione grado o curso a consultar</strong></font color></center></h4></strong></em>";
echo "<center><a href='formseccion.php'>Para salir haz click aqui</a></center>";
return;
}
elseif ($Seccion ==Null )
{
echo "<h4><center><font color='red'><strong>Error Campo Seccion vacio</strong></font color></center></h4>";
echo "<h4><center><font color='red'><strong>Por favor seleccione seccion a consultar</strong></font color></center></h4></strong></em>";
echo "<center><a href='formseccion.php'>Para salir haz click aqui </a></center>";
return;
}
$registros=mysql_query("select count(*) as cantidad from inscritos WHERE Grado = '$Grado' AND Seccion = '$Seccion'",$conexion) or die("Problemas en el select:".mysql_error());
$reg=mysql_fetch_array($registros);
echo "Registrados " .$reg['cantidad']; echo " Estudiantes "; echo " de $Grado Grado de la Seccion $Seccion";

$Filtros="SELECT * FROM inscritos WHERE Grado = '$Grado' AND Seccion = '$Seccion'";
$Consulta=mysql_query($Filtros,$conexion) or die("Error al Procesar la Consulta de datos por favor identifique la operacion de la informacion");
echo "<center><font face ='Times New Roman, Times, serif' color='black' size='3'><table width=600 border='1' cellspacing='0' bgcolor='white' bordercolor='BLACK'>";
echo "<th>Cedula</th>";
echo "<th>Nombres</th>";
echo "<th>Apellidos</th>";
echo "<th>Grado</th>";
echo "<th>Seccion</th>";
$cantidad=mysql_num_rows($Consulta);
if ($cantidad<'1')
{
echo "<center><b><font color='red'>!ERROR! No se Encontro Informacion para $Grado de la Seccion $Seccion</font color></b></center>";
}
else
{
while ($rs=mysql_fetch_array($Consulta))
{
echo "<tr><td><div align='center'>",$rs['Ced_alumno'],"</td>";
echo "<td><div align='center'>",$rs['Nom_alumno'],"</td>";
echo "<td><div align='center'>",$rs['Ape_alumno'],"</td>";
echo "<td><div align='center'>",$rs['Grado'],"</td>";
echo "<td><div align='center'>",$rs['Seccion'],"</td>";
}
echo "</font>";
echo "</table></center>";

}
?>
</span> </p>
<p class="Estilo8">
<script type="text/javascript" language="JavaScript1.2">
<!--
function printPage()
{
document.getElementById('print').style.visibility = 'hidden';
// Do print the page
if (typeof(window.print) != 'undefined') {
window.print();
}
document.getElementById('print').style.visibility = '';
}
//-->
</script>

<?php
$strPrint="Imprimir";
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" id="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
echo "<center><a href='inicio.php'>Salir</a></center>";
?>