Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/11/2011, 11:10
propa
 
Fecha de Ingreso: noviembre-2011
Mensajes: 27
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: duda con <select>

este es el codigo

Código PHP:
<?php
require("verificar_sesion.php");
require (
"conexion.php");
$grado=$_REQUEST["grado"];
$id=$_REQUEST["id"];

$consul_docente="SELECT * FROM docente";
$consul_materias="SELECT * FROM materias WHERE id_materia=$id";
$query=mysql_query($consul_docente,$con);
$query2=mysql_query($consul_materias,$con);
if(
mysql_num_rows($query)==)
echo 
"Inserte Docentes";
if(
mysql_num_rows($query2)==)
echo 
"Inserte Materias";
$fila=mysql_fetch_array($query2);
$fila2=mysql_fetch_array($query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modificar Materias</title>
</head>
<body>
<h1 align="center">Modificar Materias
</h1>
<p align="right"><a href="menu.php">Regresar al Menu</a> - <a href="materia.php">Atras</a> - <a href="salir.php">Salir</a></p>
<p align="center"><strong>Modificar Materias del grado:</strong> <?php echo $grado?> </p>
<form id="form1" name="form1" method="post" action="modificar_datos_materia.php?id_m=<?php echo $id;?>">
  <table width="90%" border="0" align="center">

    <tr>
      <td width="46%"><div align="right"><strong>Nombre:</strong></div></td>
      <td width="54%"><input type="text" name="nom_materia" id="nom_materia" value="<?php echo $fila["nom_materia"];?>" /></td>
    </tr>
    <tr>
      <td><div align="right"><strong>Docente:</strong></div></td>
      <td>
      <select name="docente" id="docente">
        <option >Seleccione Docente</option>
<?php
$consul_docente
="SELECT * FROM docente";
$query=mysql_query($consul_docente,$con);
 while (
$fila=mysql_fetch_array($query)){
echo 
"<option value='" .$fila['cedula'] ."'>" .$fila['nombre'] . " "$fila['apellido'] ." </option>";
}
?>
      </select>

      </td>
    </tr>
    <tr>
      <td><div align="right">Grado:</div></td>
      <td><select name="grado" id="grado">
        <option>Seleccione Grado</option>
              <?php
              $con_grado
="SELECT * FROM grado";
              
$query_grado=mysql_query($con_grado,$con);
              while (
$fila3=mysql_fetch_array($query_grado)){
        echo 
"<option value='" .$fila3["nom_grado"] ."'>" .$fila3['nom_grado'] . "</option>";
              }
      
mysql_close($con);
      
?>
        
      </select></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Enviar" /></td>
    </tr>
  </table>

</form>
<p align="center">&nbsp;</p>
</body>
</html>