Visualizzazione dei risultati da 1 a 4 su 4

Discussione: timestamp

  1. #1

    timestamp

    salve ragazzi
    qualcuno sa' dirmi perchè quando aggiorno (UPDATE) un articolo nel database il campo timestamp si aggiorna in automatico con la data attuale? Come posso fare perchè quella data non si aggiorni?

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    460
    E' una delle 'features' nascoste di MySQL: il primo campo TIMESTAMP di ogni tabella viene automaticamente impostato a NOW() ad ogni update. Bello, no?

    L'unico modo per risolvere e' fare:

    UPDATE TABELLA SET (LISTA CAMPI, CAMPO_TIMESTAMP) = (LISTA_VALORI, CAMPO_TIMESTAMP)
    There are 10 types of people in the world - those who understand binary and those who don't.

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    460
    Alternativamente aggiungi un altro campo timestamp: il secondo non viene aggiornato in automatico.
    There are 10 types of people in the world - those who understand binary and those who don't.

  4. #4
    grazie 1000!!!!!
    luca

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.