Foros del Web » Programando para Internet » PHP »

Problema con PHP

Estas en el tema de Problema con PHP en el foro de PHP en Foros del Web. olap, ab kien me puede solucionar esto plis :P <? $agc = $_POST['agc']; $fol = $_POST['fol']; $bd = $_POST['bd']; $mpi = $_POST['mpi']; $ims = $_POST['ims']; ...
  #1 (permalink)  
Antiguo 12/05/2005, 13:45
 
Fecha de Ingreso: mayo-2005
Mensajes: 6
Antigüedad: 18 años, 11 meses
Puntos: 0
Problema con PHP

olap, ab kien me puede solucionar esto plis :P

<?
$agc = $_POST['agc'];
$fol = $_POST['fol'];
$bd = $_POST['bd'];
$mpi = $_POST['mpi'];
$ims = $_POST['ims'];
include ("../conectarbd.php");
if ($asignatura=="agc")
{$result=mysql_query("update notas set agc='$agc' where id_nota='$id'");}
elseif ($asignatura=="fol")
{$result=mysql_query("update notas set fol='$fol' where id_nota='$id'");}
elseif ($asignatura=="bd")
{$result=mysql_query("update notas set bd='$bd' where id_nota='$id'");}
elseif ($asignatura=="mpi")
{$result=mysql_query("update notas set mpi='$mpi' where id_nota='$id'");}
elseif ($asignatura=="ims")
{$result=mysql_query("update notas set ims='$ims' where id_nota='$id'");}
?>

me inserta el campo como 0, help plis
  #2 (permalink)  
Antiguo 12/05/2005, 13:56
Avatar de jam1138
/** @package Moderador */
 
Fecha de Ingreso: julio-2004
Ubicación: sèveR led onieR lE
Mensajes: 9.368
Antigüedad: 19 años, 9 meses
Puntos: 102
Debes de ser más explicativo... y procura encerrar el código entre etiquetas [ PHP].

¿haz comprobado que recibez correctamente los valores de tu formulario???; imprimelos para que los veas.
__________________
٩(͡๏̯͡๏)۶
» Cómo hacer preguntas de manera inteligente «

"100 años después, la revolución no es con armas, es intelectual y digital"
  #3 (permalink)  
Antiguo 12/05/2005, 14:00
 
Fecha de Ingreso: mayo-2005
Mensajes: 6
Antigüedad: 18 años, 11 meses
Puntos: 0
<FORM METHOD="POST">
<br>AGC <br><INPUT TYPE="TEXT" NAME="agc"><br>
FOL <br><INPUT TYPE="TEXT" NAME="fol"><br>
BD <br><INPUT TYPE="TEXT" NAME="bd"><br>
MPI <br><INPUT TYPE="TEXT" NAME="mpi"><br>
IMS <br><INPUT TYPE="TEXT" NAME="ims"><br>
<INPUT TYPE="SUBMIT" value="Insertar datos">
</FORM></div>

<?
$agc = $_POST['agc'];
$fol = $_POST['fol'];
$bd = $_POST['bd'];
$mpi = $_POST['mpi'];
$ims = $_POST['ims'];
include ("../conectarbd.php");
if ($asignatura=="agc")
{$result=mysql_query("update notas set agc='$agc' where id_nota='$id';");}
elseif ($asignatura=="fol")
{$result=mysql_query("update notas set fol='$fol' where id_nota='$id';");}
elseif ($asignatura=="bd")
{$result=mysql_query("update notas set bd='$bd' where id_nota='$id';");}
elseif ($asignatura=="mpi")
{$result=mysql_query("update notas set mpi='$mpi' where id_nota='$id';");}
elseif ($asignatura=="ims")
{$result=mysql_query("update notas set ims='$ims' where id_nota='$id';");}
?>

no se si asi estara mejor
  #4 (permalink)  
Antiguo 12/05/2005, 14:46
Avatar de dwaks  
Fecha de Ingreso: agosto-2002
Ubicación: Panamá
Mensajes: 962
Antigüedad: 21 años, 8 meses
Puntos: 15
<FORM METHOD="POST">
<br>AGC <br><INPUT TYPE="TEXT" NAME="agc"><br>
FOL <br><INPUT TYPE="TEXT" NAME="fol"><br>
BD <br><INPUT TYPE="TEXT" NAME="bd"><br>
MPI <br><INPUT TYPE="TEXT" NAME="mpi"><br>
IMS <br><INPUT TYPE="TEXT" NAME="ims"><br>
<INPUT TYPE="SUBMIT" value="Insertar datos">
</FORM></div>

Este formulario le falta el id que usaras para decir where id = '$id'

Si ese id no esta definido no encontrara nada que actualizar.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:58.