Ver Mensaje Individual
  #17 (permalink)  
Antiguo 05/01/2010, 12:43
Avatar de danistrein
danistrein
 
Fecha de Ingreso: septiembre-2008
Ubicación: Salta Capital
Mensajes: 550
Antigüedad: 15 años, 7 meses
Puntos: 9
Respuesta: sumar restar php

Cita:
Iniciado por abimaelrc Ver Mensaje
Oh, ok, se me olvido colocar un incremetandor, igual que el $numero++ pero tienes que hacerlo tambien con $puntos++;. Ademas el $numero++ no debe ir dentro del segundo while si no solamente dentro del primer while.
jeje muchísimas gracias muchachos, ya pude terminarlo :P, aki esta y funciona muy bien.

les agreadesco mucho la ayuda abimaelrc y pato12

Código PHP:
Ver original
  1. <form method="post" action="">
  2. <?php
  3. $sql = "SELECT usuario_puntos FROM one_info WHERE usuario='$user_id'";
  4. $r = mysql_query($sql) or die(mysql_error());
  5. while($row = mysql_fetch_assoc($r)){
  6. $puntosusuario = $row['usuario_puntos'];
  7. $numero=1;
  8. $puntos=1;
  9. if($puntosusuario==0)echo "No Tienes Puntos.";
  10. while($puntos<=$puntosusuario){
  11. ?>
  12. <input type="submit" name="puntos" value="<?=$numero?>" />
  13. <?php
  14. $puntos++;
  15. $numero++;
  16. }}
  17. ?>
  18. </form>
__________________
Appones.net - www.appones.net