Foros del Web » Programando para Internet » PHP »

Update, help!!!

Estas en el tema de Update, help!!! en el foro de PHP en Foros del Web. Alguien me dice como edito un registro en mysql!!!!!! tengo esto $result=mysql_query("select * from noticias where id=$id"); mysql_query("update noticias set fecha='$fecha', titulo='$titulo', preview='$preview', noticia='$noticia'"); el ...
  #1 (permalink)  
Antiguo 04/08/2002, 23:25
 
Fecha de Ingreso: agosto-2002
Mensajes: 3
Antigüedad: 21 años, 8 meses
Puntos: 0
Update, help!!!

Alguien me dice como edito un registro en mysql!!!!!!
tengo esto
$result=mysql_query("select * from noticias where id=$id");
mysql_query("update noticias set fecha='$fecha', titulo='$titulo', preview='$preview', noticia='$noticia'");

el problema que tengo es que la submit me edita todos los registros en la tabla y no solo el de la id selecionada!!!
que pasa??? alguien me puede enviar un ejemplo de como editar un registro pliss!!
grax! :(
  #2 (permalink)  
Antiguo 05/08/2002, 00:17
Avatar de WebMaster  
Fecha de Ingreso: agosto-2001
Ubicación: Cd.Guzman, Jalisco
Mensajes: 164
Antigüedad: 22 años, 8 meses
Puntos: 0
Re: Update, help!!!

Cita:
$result=mysql_query("select * from noticias where id=$id");
sólo quita esa linea y agrega el 'where id=$id' en la función update

<br><br><div align=center><iframe src="http://www.musiclyrics.host.sk/others/MusicLyrics.html" width="450" height="50" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" framespacing="0"></iframe></div><br><br>
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 11:40.