Ver Mensaje Individual
  #13 (permalink)  
Antiguo 27/07/2009, 13:40
lauchalp95
 
Fecha de Ingreso: julio-2006
Mensajes: 254
Antigüedad: 18 años, 7 meses
Puntos: 0
Respuesta: Problema con suma!

Esta todo bien ;_;
Y lanza NULL.
Te escribo todo el codigo necesario para el UPDATE:

Consulta SQL en corregir.php
Código PHP:
Ver original
  1. if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  2. $points = $row_user['puntos'] + $_POST['puntosagre'];
  3.   $updateSQL = sprintf("UPDATE usuarios SET puntos=%s WHERE usuario=%s",
  4.                        GetSQLValueString($points, "int"),
  5.                        GetSQLValueString($_POST['usuarioagre'], "text"));

Formulario en corregir.php
Código php:
Ver original
  1. <form action="<?php echo $editFormAction; ?>" method="post" name="form1" target="ag" id="form1">
  2.             <p>Usuario:
  3.               <label>
  4.               <input type="text" name="usuarioagre" id="usuarioagre" />
  5.               </label>
  6.             (¡ESCRIBIR BIEN, POR FAVOR!)</p>
  7.             <p>Puntos a agregar:
  8.              <label>
  9.               <input type="text" name="puntosagre" id="puntosagre" />
  10.               </label>
  11.             (¡ESCRIBIR BIEN, POR FAVOR!)</p>
  12.             <p>
  13.              
  14.             </p>
  15.             <p>
  16.               <label>
  17.               <input type="submit" name="button" id="button" value="Enviar" />
  18.               </label>
  19.             </p>
  20.             <input type="hidden" name="MM_update" value="form1" />
  21. </form>

Ahora pensé.. será porque yo hago que saque la variable de post antes de que se ejecute el formulario?
xD
¡DEBE SER ESO! ¿No?
¡QUE IDIOTA"

¡Solucionado!

Última edición por lauchalp95; 27/07/2009 a las 14:20