Ver Mensaje Individual
  #13 (permalink)  
Antiguo 04/07/2011, 17:46
Kilin
 
Fecha de Ingreso: junio-2011
Mensajes: 92
Antigüedad: 12 años, 11 meses
Puntos: 3
Respuesta: Arreglar codigo UPDATE en PHP

Cita:
Iniciado por skiper0125 Ver Mensaje
Perdon tiene errores

Código PHP:
Ver original
  1. $id=$_POST['id'];
  2.     $noticiauno=$_POST['noticia1'];
  3.     $noticiados=$_POST['noticia2'];
  4.     $noticiatres=$_POST['noticia3'];
  5.     $noticiacuatro=$_POST['noticia4'];
  6.     $noticiacinco=$_POST['noticia5'];
  7.      
  8.      
  9.     $link = mysql_connect("serv", "user", "pswd") or die("Error server".mysql_error());
  10.      
  11.     mysql_select_db("db", $link);or die("Error base de datos: ".mysql_error());
  12.     $sql = "UPDATE home SET id_noticia='$id', noticiauno='$noticia1', noticiados='$noticia2', noticiatres='$noticia3', noticiacuatro='$noticia4', noticiacinco='$noticia5' WHERE id_noticia='$id'";
  13.      
  14.     $result = mysql_query($sql) or die("Error en consulta $sql: ".mysql_error() );
  15.      
  16.     header("location: index.php");
Bueno, probando ese codigo me di cuenta de que uno de mis fallos era poner en el update $noticia1 cuando deberia ser $noticiauno

pero con ese codigo y el fallo mio arreglado, no me da ningun fallo, pero tampoco se modifica nada