Ver Mensaje Individual
  #8 (permalink)  
Antiguo 21/03/2014, 21:37
gus_manson_arizmendi
 
Fecha de Ingreso: marzo-2014
Mensajes: 34
Antigüedad: 10 años, 1 mes
Puntos: 0
Respuesta: Error en buscador con PHP y MySQL.

form_consulta.php
<?php
session_start();
include "con_bd_kinder.php";
include "positiontop.php";
?>
<html>
<header>
<style type="text/css" >
/*Dando estilo al contenedor que es la división principal, esta cotiene a todos los demas div*/
#entrada{
width:400px;
height:150px;
background-color:#888;
}

legend{
color:#EEE;
background: #1797d2;
font-family: Arial, Helvetica, Sans-serif;
font-size: 0.9em;
font-weight: bold;
padding: 5px;
margin-bottom: 0;
width: 16em;
border: 1px solid #3E4A49;
}

label{
width: 12 em;
float:left;
text-align:left;
margin-right: 1 em;
display: block;
color:#EEE;
}

#new{
width: 20em;
float:left;
text-align:left;
margin-right: 0.5em;
display: block;
color:#EEE;
}

#mayus{ text-transform:uppercase;}

</style>
<title>Buscador</title>
</header>
<body>
<p>
<?php
if(isset($_SESSION['usuario'])){
echo "Hna: ".$_SESSION['usuario'];
}else{
echo "Acceso Restringido";
}
?>
</p>
<div id="entrada">
<form name="consulta1" method="post" action="mostrar_datos.php">
<legend ><span style="text-decoration:blink;">I</span>ngrese los datos a buscar:</legend>
Id. Inscripción:<input type="text" name="id" id="id" maxlength="100">* <br />
<input type="submit" value="Aceptar"><br />
<input type="button" name="Retornar" value="<--Volver" onClick="location.href='kinder.php'" />
</form>
</div>
</body>
</html>

mostrardatos.php
<?php
session_start();
include "positiontop.php";
?>
<html>
<title>Mostrar datos</title>
<body>
<style type="text/css" >
/*Dando estilo al contenedor que es la división principal, esta cotiene a todos los demas div*/
#entrada{
width:400px;
height:150px;
background-color:#888;
}

legend{
color:#EEE;
background: #1797d2;
font-family: Arial, Helvetica, Sans-serif;
font-size: 0.9em;
font-weight: bold;
padding: 5px;
margin-bottom: 0;
width: 16em;
border: 1px solid #3E4A49;
}

label{
width: 12 em;
float:left;
text-align:left;
margin-right: 1 em;
display: block;
color:#EEE;
}

#new{
width: 20em;
float:left;
text-align:left;
margin-right: 0.5em;
display: block;
color:#EEE;
}

#mayus{ text-transform:uppercase;}

</style>
<?php
if(isset($_SESSION['usuario'])){
echo "Hna: ".$_SESSION['usuario'];
}else{
echo "Acceso Restringido";
}

require("con_bd_kinder.php");
$conexion=bdcon();

$sqlconsulta="SELECT * FROM ficha_inscripcion WHERE id_inscripcion = $_POST['id']";

$result=mysql_query($sqlconsulta, $conexion)or die("Error en la actualizacion SQL".mysql_error());
if(!$result){
echo "<html><script>alert(\"Ocurrio un error, vuelva a intentar.\"); window.location='aplicacion.php';</script></html>";
}else {
echo "<table border='1'> \n";
echo "<tr>
<td>Id</td>
<td>Apellido Paterno</td>
<td>Apellido Materno</td>
<td>Nombre</td>
<td>Fecha de Nacimiento</td>
<td>CURP</td>
<td>Medicamentos que le Afectan</td>
<td>Alimentos que le gustan</td>
<td>Paseos que le gustan</td>
<td>Juguetes que le gustan</td>
<td>Dispuesto a no Faltar al Kinder y a la Guarderia</td>
<td>Solo Asistir al Kinder</td>
<td>Cuanto tiempo se queda solo en casa</td>
<td>A qué horas toma sus alimentos</td>
<td>Nombre del Padre</td>
<td>Nombre de la Madre</td>
<td>Domicilio</td>
<td>Telefono</td>
<td>Ocupación</td>
<td>Escolaridad</td>
<td>Nombre y Firma</td>
<td>Fecha de Inscripción</td>
<td>Comformidad de los Padres y de la Institución</td>";
echo "</table>";
while ($row = mysql_fetch_row($result)){
?>
<tr>
<td class="style1"><div align="center"><?php echo $row[0]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[1]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[2]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[3]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[4]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[5]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[6]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[7]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[8]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[9]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[10]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[11]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[12]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[13]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[14]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[15]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[16]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[17]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[18]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[19]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[20]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[21]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[22]; ?></div></td>
<td class="style1"><div align="center"><?php echo $row[23]; ?></div></td>
</tr>
<div align="center"><span class="style1">
<?php
}
}
echo "</table>";
//}
?>

<input type="button" name="Retornar" value="<--Volver" onClick="location.href='kinder.php'" />
</body>
</html>