Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/09/2010, 11:30
JuanMi23
 
Fecha de Ingreso: abril-2007
Mensajes: 54
Antigüedad: 17 años, 9 meses
Puntos: 1
Respuesta: Problema update PHP

Cita:
Iniciado por rickyper Ver Mensaje
Postea tu codigo
no tiene mucho secreto eh....


Código PHP:
Ver original
  1. $txt= $_POST[comentario];
  2.  
  3.  
  4. $comen= $txt;
  5. $precio= ereg_replace("[^A-Za-z0-9]", "",$_POST[precio]);
  6.    
  7.  
  8. $sql="
  9. UPDATE inmueble
  10. SET `direccion`=  '$_POST[direccion]',
  11. `provincia`= '$_POST[provinciaList]',
  12. `poblacion`= '$_POST[localidadList]',
  13. `habitaciones`= '$_POST[habitaciones]',
  14. `superficie`= '$_POST[superficie]',
  15. `banyos`= '$_POST[banyos]',
  16. `precio`= '$precio',
  17. `tipo`= '$_POST[tipo]',
  18. `estado`= '$_POST[estado]',
  19. `comentario`= '$comen'
  20. WHERE referencia='$_POST[referencia]'
  21. ";
  22.  
  23. echo $sql;
  24.  
  25. if (!mysql_query($sql,$con))
  26.  
  27.   {
  28.  
  29.   die('Error: ' . mysql_error());
  30.  
  31.   }

Lo que pasa,que la cadena me la corta al updatear.