Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/08/2012, 18:05
Avatar de topo_bionico
topo_bionico
 
Fecha de Ingreso: junio-2012
Mensajes: 89
Antigüedad: 11 años, 10 meses
Puntos: 20
Respuesta: php actualizar datos mysql

Te falta agregar las comillas simples para que tome el valor como texto y no como nombre de funciones.

Código PHP:
Ver original
  1. $registro=mysql_query("select ".$EXP.", ".$AP." , ".$A." from ".$PB." where ".$NG."='$_POST[r1]'");
  2.  
  3. while($reg=mysql_fetch_array($registro)){
  4. echo $reg["$EXP"];
  5.  
  6. mysql_query("UPDATE ".$MC." SET $EXP='".$reg["$EXP"]."' WHERE ".$NG."=1 ", $conexion);
  7. mysql_query("UPDATE ".$MC." SET $AP='".$reg["$AP"]."' WHERE ".$NG."=1 ", $conexion);
  8. mysql_query("UPDATE ".$MC." SET $A='".$reg["$A"]."' WHERE ".$NG."=1 ", $conexion);
  9.  
  10. }