Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/02/2011, 13:57
walterdevel
 
Fecha de Ingreso: diciembre-2010
Mensajes: 788
Antigüedad: 13 años, 4 meses
Puntos: 51
Respuesta: ayuda con repetir campos con diferentes valores

Lo que tenés que hacer, es un while:

$tot_ref = $_REQUEST['todos_ref'];
echo $tot_ref;
$sql = "select * from OT where (ID_equipo = '$tot_ref')";
$datos = mysql_query ($sql, $conexion) or die ("Error al consultar2");
while($consulta = mysql_fetch_array ($datos)) {
$id_ot=$consulta[0];
$fecha=$consulta[3];
$prioridad=$consulta[19];
$tipo_mto=$consulta[0];
$operario=$consulta[18];
$desc_aver=$consulta[4];
//consultas para equipo
$sqlequipo = "select * from equipos natural join OT where (ID_equipo='$todos_ref')";
$equipo = mysql_query ($sqlequipo,$conexion) or die ("Error al consultar3");
$regequipo = mysql_fetch_array($equipo);
$des_equipo=$regequipo[1];
// tipo mto
$sqlmto = "select * from tipo_mto natural join OT where (ID_equipo='$todos_ref') ";
$mto = mysql_query ($sqlmto,$conexion) or die ("Error al consultar4");
$regmto = mysql_fetch_array($mto);
$des_mto=$regmto[1];

//fem filas
?>
<tr>
<td><input type="text" readonly="readonly" value="<?php print ($id_ot)?>"></td>
<td><input type="text" readonly="readonly" value="<?php print ($fecha)?>"></td>
<td><input type="text" readonly="readonly" value="<?php print ($prioridad)?>" ></td>
<td><input type="text" readonly="readonly" value="<?php print ($des_equipo)?>"></td>
<td><input type="text" readonly="readonly" value="<?php print ($des_mto)?>"></td>
<td><input type="text" readonly="readonly" value="<?php print ($operario)?>"></td>
<td><textarea readonly="readonly" value="<?php print ($desc_aver)?>"></textarea></td>
</tr>

<?
}
?>