Ver Mensaje Individual
  #7 (permalink)  
Antiguo 30/11/2011, 11:37
cancer_15_4_9
 
Fecha de Ingreso: julio-2011
Ubicación: Veracruz
Mensajes: 36
Antigüedad: 12 años, 9 meses
Puntos: 0
Respuesta: Consultar Registro de BD en Formularios

Cita:
<?php
if (isset($_POST['variable'])){
$bd_host = "BEREESSEC-PC\SQLEXPRESS";
$bd_usuario = "sa";
$bd_password = "123456";
$bd_base = "SERCAP";

$con = mssql_connect($bd_host, $bd_usuario, $bd_password);

mssql_select_db($bd_base, $con);

//consulta todos los empleados
$id=$_POST['txtId_matriz'];
$sql=mssql_query("SELECT * FROM TMatrizAdoctrinamientoEncabezado where Id_matriz='$id'",$con);
while($row = mssql_fetch_array($sql)){
$revision=$row['Revision'];

}
}
?>
<html>
<form id='forma' method="post" action="formulario.php">
<table>
<tr><td><input type="text" name="txtId_matriz" onKeyPress="if (event.keyCode==13){if(this.value!='') document.getElementById('forma').submit();}"/></td></tr>
<tr><td><input type="text" name="Revision" value="<?php if(isset($revision)) echo $revision; ?>"/></td></tr>
</table>
</form>
</html>

Es es el codigo que gener le cambie en evento al input y probe tambien con el evento que pusiste pero nada.

Ah y el segundo codigo ahi no se que. Donde lo debo de poner. Espero me puedas ayudar