Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/12/2009, 05:14
visona
 
Fecha de Ingreso: febrero-2008
Mensajes: 675
Antigüedad: 16 años, 3 meses
Puntos: 5
Respuesta: Limitar a 2 decimales

Ahora tengo otro problema, y es que no se como hacer para que me coja el campo que le corresponde a cada uno de los articulos.
Código PHP:
  <table>
        <tr>
          <td><?php do { ?>
           <?php 
    $botellas
=($row_stock['cantidad']/$row_stock['stud']);
    
?>
              <table width="550" border="0">
                    <tr>
                      <td width="90"><?php echo $row_stock['cantidad']; ?></td>
                      <td width="73"><?php echo $row_stock['forma']; ?></td>
                      <td width="200"><?php echo $row_stock['articulo']; ?></td>
                      <td width="90"><form id="form1" name="form1" method="post" action="">
                        <input name="unidades" type="hidden" id="unidades" value="<?php echo $row_stock['stud']; ?>" />
<input name="eso" type="text" id="eso" value="<?php echo round$botellas2); ?>" />
                      </form></td>
                      <td width="75">&nbsp;</td>
                  </tr>
                            </table>
              <?php } while ($row_stock mysql_fetch_assoc($stock)); ?></td>
        </tr>
      </table>
Esta formula, lo que em hace es cogerme el primer registro y aplicarselo a todos, o sea que si el primer registro es 14, me divide todos los articulos por 14, cuando me gustaria que me aplicara la formula segun el campo stud de cada registro. osea que si hay un registro con el campo "stud" con un 5 pues que me lo divida con por 5.
Alguna idea?
Un saludo