21/01/2013, 09:49
|
| | | Fecha de Ingreso: septiembre-2012 Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 5 meses Puntos: 10 | |
Respuesta: Insertar y hacer el Select. Cita:
Iniciado por tony_la09 Por ejemplo para recuperar una consulta hago algo asi
Código PHP:
Ver original<?php include ("conexion.php"); $tabla = "alumnos"; $campo = $_POST['campo']; $consulta = "SELECT * FROM $tabla WHERE (matricula = '$campo' OR nombre = '$campo') "; if ($numrows <=0){ echo "LA MATRICULA O EL NOMBRE: ".$campo." NO EXISTE<br><br>"; echo "PULSE <a href='frmConsultar_Alumno.php'>AQUI</a> SI DESEAS REALIZAR OTRA CONSULTA.<br><br>"; echo "PULSE <a href='Inicio.php'>AQUI</a> SI DESEA IR A LA PAGINA PRINCIPAL."; echo "<br><br><br>"; include ("pie.php"); } elseif ($numrows > 0){ } ?> <table align="center" width="750" cellspacing="1" cellpadding="3" border="1" bgcolor="#000000"> <tr bgcolor="#FFFFFF"> <th>Matricula</th> <th>Nombre</th> <th>Apellido Paterno</th> <th>Apellido Materno</th> </tr> <tr align="center" bgcolor="#FFFFFF"> <td id="estilo"><?php echo $matricula; ?></td> <td id="estilo"><?php echo $nombre; ?></td> <td id="estilo"><?php echo $app; ?></td> <td id="estilo"><?php echo $apm; ?></td> </tr> </table> <br><br> <p>PULSE <a href="frmConsultar_alumno.php">AQUI</a> SI DESEA HACER OTRA CONSULTA.</p><br> <p>PULSE <a href="Inicio.php">AQUI</a> SI DESEA IR A LA PAGINA PRINCIPAL.</p> <br><br><br> </div>
Gracias. |