Código HTML:
<td valign="middle"><select name="combo1" id="combo1" style="width:200px" > <option value="0">Seleccionar</option> <?php $db = new MySQL(); $db->open(); $consulta = $db->consulta("SELECT * FROM licenciaturas"); if ($row = $db->fetch_array($consulta)) { do { echo '<option value="'.$row[licenciatura].'">'.$row[licenciatura].'</option>'; }while($row = $db->fetch_array($consulta)); } ?> </select></td> </tr> <tr valign="baseline"> <td align="right" valign="middle">Clave Semestre:</td> <td valign="middle"> <select name="combo2" id="combo2" style="width:200px"> </select> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle"><input type="button" value="Cancelar" onClick="history.back()" /></td> <td valign="middle"><input type="submit" value="Crear" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1" /> </form>
Código PHP:
<?php
include("../includes/config.inc.php");
include("../includes/mysql.class.php");
$db = new MySQL();
$db->open();
$consulta = $db->consulta("SELECT * FROM grados1 WHERE licenciatura LIKE '$_POST[elegido]'");
if ($row = $db->fetch_array($consulta)) {
do {
echo
'<option value="'.$row['idgrado'].'">'.$row['idgrado'].'</option>';
}while($row = $db->fetch_array($consulta));
}
?>
Alguien me puede ayudar Gracias