Da mysql 4 a mysql 5 – Insert Datetime

Aggiornando il server qualche query ha cominciato a dare errore; in particolare, se avete un campo di tipo datetime, e non volevate valorizzarlo potevate inserire nella insert la stringa ” (stringa vuota)

In mysql 4 si aveva:

” -> ’0000-00-00 00:00:00′

In mysql 5:

” -> Errore

Ho risolto mettendo come valore del campo: ’00000000000000′.

Tutto per la pigrizia di non specificare i campi nella insert.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>