Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/04/2007, 06:08
workculture
 
Fecha de Ingreso: junio-2005
Mensajes: 80
Antigüedad: 18 años, 10 meses
Puntos: 0
Re: cargar input con datos de la base de datos

Ok, aquí está el scrip entero en php

<?php

$db_host="***";
$db_usuario="***";
$db_password="***";
$db_base="***";
$con=mysql_connect($db_host,$db_usuario,$db_passwo rd) OR die ("no se puede conectar a la base de datos. \n");


$num_proyecto=$_POST['var_number'];
//Conexi&oacute;n a la base de datos
mysql_select_db($db_base,$con) OR die ("no se puede encontrar la base de datos.");

$consult="SELECT * FROM proyectos WHERE idproyecto=$num_proyecto";
$result=mysql_query($consult);
$num_registros=mysql_num_rows($result);
$fila=mysql_fetch_array($result);
echo '<br> numero de registros encontrados';
echo $num_registros;

echo '<table width="450" height="1756" border="0" align="left" bgcolor="#FBFBFB">';
echo '<tr>';
echo '<td height="32" colspan="2" class="Estilo6"><div align="center" class="Estilo4"></div></td>';
echo '</tr>';
echo '<tr>';
echo '<td height="25" colspan="2" class="Letra_texto"><div align="left" class="Estilo9">C&oacute;digo/Identificaci&oacute;n del proyecto</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td height="25" colspan="2" class="Letra_texto">';
echo '<div align="left">';
echo '<input name="f1_id" type="text" size="40" maxlength="40" class="Estilo10" id="f1_id3" height="" value='.$fila['idproyecto'].'>';
echo '</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td height="25" colspan="2" class="Letra_texto">';
echo '<div align="left" class="Estilo9">Nombre programa</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td height="25" colspan="2" class="Letra_texto"><div align="left">';
echo '<input name="f2_programa" type="TEXT" class="Estilo10" id="f2_programa2" value='.$fila['nombre_programa'].'>');
echo '<tr>';
echo '<td height="25" colspan="2" class="Letra_texto"><div align="left"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;"><span class="Estilo9">Nombre de la convocatoria </span></span></div></td>';
echo '</tr>';
echo '<tr>';
echo '<td height="25" colspan="2">';
echo '<div align="left">';
echo '<input name="f3_convocatoria" type="text" class="Estilo9" size="80" maxlength="80" value='.$fila['nombre_convocatoria'].'>';
echo '</div> </tr> <tr>';
echo '<td height="25" colspan="2"><div align="left" class="Estilo9">Bolet&iacute;n de publicaci&oacute;n </div>';
echo '</tr> <tr>';
echo '<td height="25" colspan="2" class="Letra_texto Estilo1 Estilo2">';
echo '<div align="left"> <p>';
echo '<input name="anteror_boletin" type="text" class="Estilo10" value='.$fila['doce_publicacion'].'>';
echo $fila['doce_publicacion'];
echo '<input name="f4_boletin" class="Estilo10" id="f4_boletin" size="80" maxlength="80" height="" value=';
echo $fila['fecha_boletin'];
echo '> </p> </div></td> </tr> <tr>';
echo '<td height="25" colspan="2" class="Letra_texto Estilo1 Estilo2"><div align="left" class="Estilo9">Fecha del bolet&iacute;n </div></td>';
echo '</tr>';
echo '<tr>';
echo '<td height="25" colspan="2"><div align="left"><span class="Estilo9">Objetivos</span> </div>
<div align="left"></div>
</tr>
<tr>
<td height="283" colspan="2">
<div align="left"><span class="Estilo8">';
echo '<textarea name="f7_objetivos" cols="80" rows="20" class="Estilo10" id="textarea" value=';
echo $fila[objetivos];
echo '></textarea>';
?