|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
inserting date into date field
i have DATE field in my MySQL database. that field is responsible for storing the date when someone registered as a user on my site. in my INSERT statement i used NOW() for the value for the field and it doesn't work. How do i insert the current date into that field?
|
|
#2
|
|||
|
|||
|
RE: inserting date into date field
try using curdate() instead of now()...now() returns the date AND time, curdate just returns the date.
|
|
#3
|
|||
|
|||
|
RE: inserting date into date field
so can use now() if the field is DATETIME?
|
|
#4
|
|||
|
|||
|
RE: inserting date into date field
Yes.
|
|
#5
|
|||
|
|||
|
RE: inserting date into date field
You could set the MySql Field type to timestamp(8)
That would give you the date the record was created. Just a thought. Have a great day -Jim |
|
#6
|
|||
|
|||
|
RE: inserting date into date field
Cheers for that suggestion Jim - saved me some time there!
|
|
#7
|
|||
|
|||
|
RE: RE: inserting date into date field
Quote:
Glad I could help. Have a great day -Jim |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > inserting date into date field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|