|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
TIMESTAMP field
Hi,
I have a TIMESTAMP field in a table, how to automatically fill the field when adding a new record without using PHP time function? Is it possible? |
|
#2
|
|||
|
|||
|
when you insert a new row when you come to the timestamp field for the value insert a 0 without the ' that will force mysql to input the default value! which if timestamp is selected as the default value, should place a timestamp in.
hope that helps |
|
#3
|
|||
|
|||
|
You can also not specify a value for the field and mysql will insert the timestamp. For example, if you had a table like this
id int auto_increment theTime timestamp name varchar(30) and you did insert into table(name) values("Tim") then id would increment and the timestamp would be put into the theTime field. |
|
#4
|
|||
|
|||
|
Thanks.
I tried by putting an empty string for that field and the field was set to 0000-00-00. Now only I know I should set it to 0 instead. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > TIMESTAMP field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|