Ver Mensaje Individual
  #9 (permalink)  
Antiguo 15/05/2010, 07:27
gscampos
 
Fecha de Ingreso: marzo-2010
Ubicación: Leganés - Madrid
Mensajes: 9
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Formatear Fecha

Arreglé el código como indicó arriba. Pero aun no esta bien.
En el banco de datos MySQL el campo "fecha" tiene las siguientes características:

---------------------------------
campo: fecha
tipo: TIMESTAMP
predeterminado: CURRENT_TIMESTAMP
atributos: on update CURRENT_TIMESTAMP
---------------------------------

Tengo que coger la hora del ingreso del dado, por eso he elegido esta forma.
Intenté usar el tipo DATETIME pero cuando voy poner los atributos (predeterminado: CURRENT_TIMESTAMP / atributos: on update CURRENT_TIMESTAMP) el MySQL enseña el error:
--------------------
Error
consulta SQL:
ALTER TABLE `eurohoy` CHANGE `fecha` `fecha` DATETIME ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
MySQL ha dicho:
#1067 - Invalid default value for 'fecha'
--------------------
Hay como usar el DATETIME y coger la hora actual?
Aguardo.