|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I wanna add current date into my table whenever i inserts data into table i want to insert the current date into the table.
table design: ---> create table HV ( name varchar(25), id integer(11) NOT NULL AUTO_INCREMENT, date TIMESTAMP ) ----> Now i have the table in my hand. how can i insert current date? vijay |
|
#2
|
|||
|
|||
|
Since it's a timestamp you don't have to insert anything, it will automagically insert the current date/time when you insert/update a row. Also, since id is an auto_increment you don't need to insert there. Your insert statement can be:
insert into HV (name) values ('The Name'); or insert into HV values('The Name',null,null); One thing, you can't use 'date' as a field name. IIRC, 'date' is a reserved word. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > ADDING TIMESTAMP? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|