Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/06/2011, 07:07
Avatar de apolazo
apolazo
 
Fecha de Ingreso: mayo-2011
Ubicación: Cabrero
Mensajes: 118
Antigüedad: 13 años
Puntos: 2
Exclamación Modificar Datos

Hola, tengo una pag con un buscador y al seleccionar el run me redirecciona a la otra para modificarla, el tema es el siguiente.
Cuando paso a la otra pag no me muestra los datos para modificar pero si muestro el run por post lo muestra, pero no los datos de la tabla, tengo el select y funciona pero no al mostrarlos con el echo.
aqui el buscador

Código PHP:
<form action="modificar_administrativo.php" method="post" name="form1" id="form1">
              <select name="run_profesor" id="run_profesor" >
              <option value="">Seleccionar RUN</option>
              <?php 
                      $conexion
=mysql_connect("localhost","admin","admin");
                        
mysql_select_db ("comportamiento",$conexion); 
                        
                        
$sql="SELECT RUN_PROFESOR FROM profesor GROUP BY RUN_PROFESOR";
                        
$resultado=mysql_query($sql,$conexion);
                          while(
$datos=mysql_fetch_array($resultado))
                        {
                            echo 
" <option value=\"".$datos["RUN_PROFESOR"]."\">".$datos["RUN_PROFESOR"]."</option>";
                        }                      
?>
            </select>
            <input type="submit" name="button" id="button" value="Buscar" />
          </form>
aqui donde lo deveria mostrar para modificar
Código PHP:
<?php                       
$conexion
=mysql_connect("localhost","admin","admin");
mysql_select_db ("inventario",$conexion); 

$sql="SELECT contrasena_p, nombres_p, apellido_p_p, apellido_m_p, tipo_profesor FROM profesor 
WHERE RUN_PROFESOR = '"
.$_POST["run_profesor"]."'";
 
$resultado=mysql_query($sql,$conexion);
$datos=mysql_fetch_array($resultado);
                                                  
?>
Código PHP:
 <form id="form1" name="form1" method="post" action="procesar_ingreso_administrador.php">
               <table width="320" border="1" align="center">
                 <tr>
                   <td width="160">CONTRASE&Ntilde;A</td>
                   <td width="144"><input name="contrasena_p" type="text" id="contrasena_p" value="<?php echo $datos["CONTRASENA_P"?>"></td>
                 </tr>
                 <tr>
                   <td>NOMBRES</td>
                   <td><input name="nombres_p" type="text" id="nombres_p" value="<?php echo $datos["NOMBRES_P"?>"></td>
                 </tr>
                 <tr>
                   <td>APELLIDO PATERNO</td>
                   <td><input name="apellido_p_p" type="text" id="apellido_p_p" value="<?php echo $datos["APELLIDO_P_P"?>"></td>
                 </tr>
                 <tr>
                   <td>APELLIDO MATERNO </td>
  <td><input name="apellido_m_m" type="text" id="apellido_m_m" value="<?php echo $datos["APELLIDO_M_P"?>"></td>
                 </tr>
                 <tr>
                   <td>TIPO CUENTA</td>
                   <td><label for="tipo_profesor"></label>
                     <select name="tipo_disco" id="tipo_profesor">
                       <?php
                            
echo $datos["TIPO_PROFESOR"];
                            if(
$datos["TIPO_PROFESOR"]=="admin")
                            {
                            
$admin="selected";
                            }
                            if(
$datos["TIPO_PROFESOR"]=="supervisor")
                            {
                            
$supervisor="selected";
                            }
                        echo
"
                              <option value=\"admin\" $admin>admin</option>
                              <option value=\"supervisor\" $supervisor>supervisor</option>"
;
                              
?>
                     </select></td>
                 </tr>
               </table>
               <p>
                 <CENTER>
                   <input type="button" onClick="valida_envia()" name="Modificar" id="Modificar" value="Modificar" />
                 </CENTER>
               </p>
             </form>