Código:
<form name='busca' form action="agregacar.php" method="post"> <table width="34%" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="30" colspan="2" bgcolor="#AEB8DD"><div align="center">Lista Escolar </div></td> </tr> <tr> <td width="30%" bgcolor="#CFD0FC"><div align="right">Establecimiento </div></td> <td width="70%" height="28" bgcolor="#CFD0FC"> <?php include("conexion.php"); $link=conectar(); $consulta = "SELECT * FROM establecimiento ORDER BY NOM_ESTA"; $resultado = mysql_query($consulta,$link); ?> <select name="id_esta" id="id_esta"> <option value="" selected="selected">Seleccionar</option> <?php while($datos = mysql_fetch_array($resultado)){ ?> <option value="<?php echo $datos["ID_ESTA"] ?>"><?php echo $datos["NOM_ESTA"] ?> <?php $id_ciudad=$datos["ID_CIUDAD"]; $consulta1 = "SELECT * FROM ciudad where id_ciudad = '$id_ciudad'"; $resultado1 = mysql_query($consulta1,$link); $datos1 = mysql_fetch_array($resultado1); $nom_ciudad=$datos1["NOM_CIUDAD"]?> (<?php echo $nom_ciudad ?>)</option> <?php } mysql_close($link); ?> </select> <label></label> <label></label></td> </tr> <tr> <td width="30%" bgcolor="#CFD0FC"><div align="right">Curso </div></td> <td width="70%" height="28" bgcolor="#CFD0FC"> <?php $link=conectar(); $consulta = "SELECT * FROM curso ORDER BY ID_CURSO"; $resultado = mysql_query($consulta,$link); ?> <select name="id_curso" id="id_curso"> <option value="" selected="selected">Seleccionar</option> <?php while($datos = mysql_fetch_array($resultado)){ ?> <option value="<?php echo $datos["ID_CURSO"] ?>"><?php echo $datos["NOM_CURSO"] ?></option> <?php } mysql_close($link); ?> </select> <label></label> <label></label></td> </tr> <tr> <td height="30" colspan="2" bgcolor="#bac2dd"><div align="center"> <label> <input type="reset" name="Reset" value="Limpiar" /> </label> <input name="boton01" type="submit" id="boton01" value="Buscar" /> <label> <input name="boton03" type='button' onClick="location='busqueda.php'" value='Salir'/> </label> </div></td> </tr> </table> </form>