Ver Mensaje Individual
  #22 (permalink)  
Antiguo 29/08/2008, 10:19
Avatar de the_web_saint
the_web_saint
 
Fecha de Ingreso: mayo-2008
Ubicación: localhost/tierra/america/panama
Mensajes: 1.229
Antigüedad: 16 años
Puntos: 43
Respuesta: Urgente tengo problema con el proceso de cargar informacion de un combobox

Primero, no es lo que se nos sea mas facil, sino lo que necesites o lo que desees hacer.

Prueba con esto a ver:
Cita:
<p>
<table width="674" height="30" align="center">
<tr bgcolor="#CCCCCC" class="Estilo1">
</td>
</p>

<table width="600" align="center">
<tr>
<td align="left" height="25" valign="top" nowrap><div align="left"><font size="2">
<?php
//Conexion con la base de datos
$link = @mysql_connect ("localhost","root","") or
die("Error de conexion: ".mysql_error());

@mysql_select_db("name",$link) or
die("Error de selección: ".mysql_error());
?>


<table width="600" align="center">
<tr>
<td align="left" height="25" valign="top" nowrap><div align="left"></div></td>
</tr>
<tr>
<td align="left" valign="top" height="25"></td>

<form name="form1" method="GET" onSubmit="" action="" id="form1">
<?php
$tarea = $_GET['combo'];
$result=mysql_query("select id_tabla, tarea from actividades order by tarea");
echo '<select name="combo" size="1" id="combo" onChange="javascript:document.form1.submit();">';
echo "<option value='0'>___</option>";

while ($row=mysql_fetch_array($result))
{
if ($row['id_tabla'] == $tarea){
echo "<option value='".$row['id_tabla']."' selected>".$row['tarea']."</option>";
}
else{
echo "<option value='".$row['id_tabla']."'>".$row['tarea']."</option>" ;
}
}
echo "</select>";
?>
</form>
<?php
$qry="select * from actividades where id_tabla='".$tarea."'";
$result1=mysql_query($qry);
$num=mysql_num_rows($result1);
if($num==1)
{
$row=mysql_fetch_array($result1);
?>

<table width="513" height="73" border="1" align="center" bordercolor="#000000" bgcolor="#DFDFDF">
<td width="189"><div align="center">Sistema de Monitoreo y Evaluaci&oacute;n </div></td>
<td width="182"><div align="center">Dependencia</div></td>

<td width="120"><div align="right">
<div align="right"><?php echo $row['dependencia'] ?></div>
</div></td>
</tr>
</table>



<table width="514" height="30" border="1" align="center" bordercolor="#000000">
<tr bgcolor="#DFDFDF">
<td width="191">Nombre de la Tarea </td>
<td width="311" height="24"><?php echo $row ['actividad'] ?></td>
</tr>
</table>
<table width="515" height="171" border="1" align="center" bordercolor="#000000">
<td width="191" bgcolor="#DFDFDF">Fecha de inicio </td>
<td width="183" height="28" bordercolor="#000000" bgcolor="#DFDFDF"><p>
<?php echo $row ['f_i'] ?></p></td>
<td width="119" rowspan="6" nowrap bordercolor="#000000" bgcolor="#DFDFDF">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td bgcolor="#DFDFDF">Fecha de final </td>
<td height="24" bordercolor="#000000" bgcolor="#DFDFDF"><?php echo $row ['f_f'] ?></a></td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td bgcolor="#DFDFDF">Fecha real de culminaci&oacute;n</td>
<td height="24" bordercolor="#000000" bgcolor="#DFDFDF"><?php echo $row ['f_r'] ?></a></td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td bgcolor="#DFDFDF">Monto de la actividad </td>
<td height="24" bordercolor="#000000" bgcolor="#DFDFDF"><?php echo $row ['monto'] ?></td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td bgcolor="#DFDFDF">Trimestre a Ejecutar </td>
<td height="31" bordercolor="#000000" bgcolor="#DFDFDF"><?php echo $row ['trimestre'] ?></td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td bgcolor="#DFDFDF">Unidad de medida: </td>
<td height="24" bgcolor="#DFDFDF"><?php echo $row ['unidad'] ?></td>
</tr>
</table>
<?php
}else{echo"No se ha encontrado un registro con esta b&uacute;squeda";}
?>
<p></p>
__________________
..::The Saint::..
El pesimista se queja del viento; el optimista espera que cambie; el realista ajusta las velas.

Última edición por the_web_saint; 29/08/2008 a las 10:19 Razón: error