Click to See Complete Forum and Search --> : Automaticaly inserting date


oo7ml
05-25-2007, 06:02 AM
Hi, i have just created a new field in my database called date. When a user submits a join form i want the date/time to be automatically inserted into the date field in the database.

I already have the value NO automatically inserted into the valid field in my database when a user submits a join form, so i just need to add the data/time function under this

$valid = 'NO';

Can someone please show me how to do this, thanks

oo7ml
05-25-2007, 09:48 AM
anyone...

bokeh
05-25-2007, 10:18 AM
Why not have a DATETIME column with a default set to NOW().

oo7ml
05-25-2007, 01:59 PM
Wow, that would be cool, how would i do that, thanks

bokeh
05-27-2007, 02:40 AM
It is possible to have the current timestamp be the default value for initializing the column... (http://dev.mysql.com/doc/refman/5.0/en/timestamp-4-1.html)