martes, 28 de julio de 2015

ESTE ES EL CODIGO QUE UTILICE PARA VISUALIZAR UN REPORTE CON EL COMBOBOX
<?php
$link= mysql_connect('localhost','root','') or die('Existe un problema con la conexion con el servidor'.mysql_error());
mysql_select_db('prueba') or die ('No se estableció conexión con la BD');

$mencion=$_REQUEST['mencion'];
$consulta="Select * from alumno";
   
    mysql_query($consulta);
   

//Ejecuta una consulta
$resultado =mysql_query ($consulta) or die ('consulta fallida'. mysql_error());
?>
<html>
    <head>
        <title>
           
        </title>
    </head>
    <body>
        <form method="post" name="form1">
        <div aligh="center" class="general" name="principal" id="general">
            <div class="banner" name="banner" id="banner">
            </div>
        </div>
        <fieldset class="formulario">
            <legend>Selecione una mención</legend>
            <select name="mencion" size="0">
                <?php
                    while($registor=mysql_fetch_array($resultado))
                    {
                        ?>
               <option value="<?php echo $registor['mencion']?>"><?php echo $registor['mencion']?></option>
                       
                        <?php
                    }
                ?>
            </select>
        </fieldset>
        <input type="submit" name="aceptar" value="enviar">
                </form>
        <?php
                echo "La mención que escogiste es:  ".$mencion; ?>

    </body>
</html>

No hay comentarios.:

Publicar un comentario