> What do you recommend as the best type of field for a timestamp in a MySQL
database? I've considered varchar(10) or INT but I'm not sure what is the
best, most efficient, and most reliable field type.
What about the TIMESTAMP type ? I don't know for storage space if it
takes less/more than an int, but at least given it's a date type of
field, you can use the typical sort operation when you're retrieving
data from the database.
However note when using that type of field that the first column with
this a timestamp type will be automatically filled with the latest
time the matching line was updated, so put any valuable data only
after the first column, unlike dummies like me who didn't know about
this (stupid imho) rule and who spent days searching where was the bug
in his scripts. I mean, what's the point ? If someone wants to keep
track of when the line was updated, he can decide himself to have such
a column and use the NOW() function, duh. Ah, done with the ranting
:-)