Re: Using UNIX_TIMESTAMP() as default field value ?

2004-01-08 Thread Keith Bussey
Currently I am using UNIX_TIMESTAMP() in my INSERTS, just the idea came to me that maybe I could use a MySQL function as a default for a field. Too bad MySQL doesn't allow it though.. Thanks for your reply though =) Oh and yeah, I knew the int(10) was for the display length ;p -- Keith Bu

Re: Using UNIX_TIMESTAMP() as default field value ?

2004-01-08 Thread Michael Stassen
Sorry, my reply was incomplete, considering your question. You want Unix timestamp format, and you want it to default to the current time. Unfortunately, you can't do both. You can use a TIMESTAMP column, which will default to NOW (the default you want), or you can use an INT column and assig

Re: Using UNIX_TIMESTAMP() as default field value ?

2004-01-08 Thread Keith Bussey
Quoting Michael Stassen <[EMAIL PROTECTED]>: > Defaults must be constants, not functions. Ahh. Thanks for the info. > You want a TIMESTAMP column, not INT. See > . I want to store my time in unix timestamp format though, not in a mmddyy type. > Mi

Re: Using UNIX_TIMESTAMP() as default field value ?

2004-01-08 Thread Michael Stassen
Defaults must be constants, not functions. You want a TIMESTAMP column, not INT. See . Michael Keith Bussey wrote: Hi all, I was wondering if it is possible to have the default value of an integer field be the current UNIX timestamp ? MySQL doesn

Using UNIX_TIMESTAMP() as default field value ?

2004-01-08 Thread Keith Bussey
Hi all, I was wondering if it is possible to have the default value of an integer field be the current UNIX timestamp ? MySQL doesn't allow me to use not null default UNIX_TIMESTAMP() . If anyone knows a way of achieving this, it would be great =) Also, I currently use "int(10) unsig