Ver Mensaje Individual
  #18 (permalink)  
Antiguo 06/09/2008, 09:54
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: Problema con FOREACH

Prueba de esta forma!

Cita:
echo "<table border='10' id='tabla'>";
echo "<tr><th bgcolor='#C0D9D9'>Fecha</th><th bgcolor='#C0D9D9'>Categoria</th><th bgcolor='#C0D9D9'>Cod</th><th bgcolor='#C0D9D9'>Descripcion</th><TH bgcolor='#C0D9D9'>Unidad</th><TH bgcolor='#C0D9D9'>Cantidad</th>";
$i = 1;
while($sql = mysql_fetch_array($consulta))
{
echo "<tr>";
echo "<td>".$fecha_."</td>";
echo "<td>".$sql['subcategoria']."</td>";
$subcat = $sql['subcategoria'];
echo "<td>".$sql['codigo']."</td>";
$codigo = $sql['codigo'];
echo "<td>".$sql['descrip']."</td>";
$desc = $sql['descrip'];
?><td class="unidad"><input type="text" name="und[<?php echo $i; ?>]" id ="und[<?php echo $i; ?>]"></td>
<td class="cantidad"><input type="text" name="cant[<?php echo $i; ?>]" id ="cant[<?php echo $i; ?>]"></td> <?
echo "</tr>";
$i++;
}
echo "</table>";
__________________
..::The Saint::..
El pesimista se queja del viento; el optimista espera que cambie; el realista ajusta las velas.