Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Need help Creating A Database that has a time element


Demaestro - 7:04 pm on Feb 14, 2012 (gmt 0)


You want to create a DB with a timestamp field.

Something like

create table table_name (

id int primary key not null,
date_created timestamp

)

Then to insert you do this:

insert into table_name values (1, now());

insert into table_name values (2, now());

insert into table_name values (3, now());

That will give you something like this

id | date_added
----------------
1 | 12-02-14 12:03:59
2 | 12-02-14 12:04:11
3 | 12-02-14 12:05:02


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4417558.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com