Re: PHP+MySQL...problemas con campos timestamp

From: Date: Wed, 08 Oct 2003 19:27:00 +0000
Subject: Re: PHP+MySQL...problemas con campos timestamp
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-41425@lists.php.net to get a copy of this message
Esto es lo que dice el manual de Mysql bueno, un poco mas extenso. http://www.mysql.com/doc/en/DATETIME.html " The DATETIME type is used when you need values that contain both date and time information. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. (``Supported'' means that although earlier values might work, there is no guarantee that they will.) The DATE type is used when you need only a date value, without a time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'. The TIMESTAMP column type provides a type that you can use to automatically mark INSERT or UPDATE operations with the current date and time. If you have multiple TIMESTAMP columns, only the first one is updated automatically " Lo que creo y si me equivoco me lo dices, es que deberias probar a usar un campo DATE en lugar de Timestamp ya que este se actualiza cuando cambias algo en ese "registro-fila" de la base de datos aunque no "toques" el campo "fechasub". Por que es su principal utilidad frente a os otros tipos de campos de "tiempo". Espero que esto te ayude, un saludo. ----- Original Message ----- From: "pepecruz" <pepe@ppicrea.com> To: "Lista_phpes" <lista@phpes.com> Sent: Wednesday, October 08, 2003 8:24 PM Subject: [PHP-ES] PHP+MySQL...problemas con campos timestamp HOla amigos, vamos a ver tengo la siguiente duda: Tengo una base de datos MySQL en la cual uno de sus campos "fechasub" es timestamp(8), despues tengo otro campo el cual es "fichero", y resulta que cuando hago una actualizacion del campo "fichero" (repito solo del campo "fichero") tambien se me actualiza el campo fechasub y se me pone a fecha del dia actual.... A alguien le ha pasado algo parecido???? el script que uso para actualizar es el siguiente: <<code>> mysql_select_db($bd,$link); $sql="UPDATE tabla1 SET fichero='$fichero' WHERE idproducto='$idproducto'"; $resultado=mysql_db_query($bd,$sql); <</code>> ...alguna solucion???? Gracias!!!! Pepe Cruz pepe@ppicrea.com www.ppicrea.com

« previous php.general.es (#41425) next »