Ver Mensaje Individual
  #13 (permalink)  
Antiguo 17/02/2011, 03:36
joanc
 
Fecha de Ingreso: febrero-2011
Mensajes: 33
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Valores de la BBDD a un textbox

Hola Nano, la linea que esta en rojo es la 43.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php

$kk = $_GET["Historia"];
echo $kk;

// Reallitzam la conexió amb el servidor
$conection = mssql_connect("servidor","usuario","password") or die ("No es pot connectar amb el servidor");
// Es selecciona la BBDD amb la que es treballarà.
mssql_select_db("BBDDl", $conection);
// Realitzam la consulta
$sql = mssql_query("select histemisor,hsmpacien.codpac,apel1,apel2,nombre,fec nac,dni
,nafss from hslie, hsmpacien where hslie.histemisor='$kk' and hsmpacien.codpac=hslie.codpac and hslie.centro_rem = '986'") or die('Invalid query: ' . mssql_error());
//while($row = mssql_fetch_array($sql))
//{
//echo $row["apel1"];
//echo $row["nombre"];
//}
//mssql_free_result($sql);

//$datos = mssql_fetch_array($sql);

while ($row = mssql_fetch_array($sql))
{
$nombre=$row["nombre"];
$apellido=$row["apel1"];
$historia=$row["histemisor"];
}

?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" media="screen" rel="stylesheet" rev="stylesheet" href="../../imagenes/estilos.css" />
<title>EHIS</title>
</head>
<body>
<div align="center">
<img src="http://www.forosdelweb.com/imagenes/SJoandeDeu1pequeño.jpg" alt="logo" width="500" height="122" align="middle" />
</div>
<h2>Datos del paciente</h2>
<div align="center">
<b>Nombre</b> <input name="nom" type="text" size="40" maxlength="80" readonly="readonly" class="caixa" value="<?php echo $nombre;?>" />

<b>Apellidos</b> <input name="cognom" type="text" size="40" maxlength="80" readonly="readonly" class="caixa" value="<?php echo $apel1;?>" />
<b>Historia</b> <input name="historia" type="text" size="20" readonly="readonly" class="caixa" value="<?php echo $row['histemisor'];?>" />
<b>Episodio</b> <input name="episodi" type="text" size="20" readonly="readonly" class="caixa" />
<b>Historia Ext</b> <input name="historiaext" type="text" size="20" maxlength="20" readonly="true" class="caixa" />
<b>Fecha nacimiento</b> <input name="dnaixe" type="text" size="10" maxlength="10" readonly="readonly" class="caixa" />
</div>
<h2>Informaci&oacute;n del paciente</h2>
<br />
<div align="center">
<input type="image" name="plaboratori" src="../../imagenes/laboratori2.JPG" onclick="window.open('http://www.google.es')" />
<input type="image" name="raig" src="../../imagenes/rx.JPG" onclick="window.open('http://www.terra.es')" />
<input type="image" name="constants" src="../../imagenes/ecg3.jpg" onclick="window.open('http://www.uoc.edu')" />
<input type="image" name="cclinic" src="../../imagenes/documentos1.jpg" onclick="window.open('http://www.policia.es')" />
<input type="image" name="imedic" src="../../imagenes/informe6.jpg" onclick="window.open('http://www.guardiacivil.org')" />
</div>
</body>
<?
mssql_close($conection);
?>
</html>