Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old March 13th, 2004, 06:09 PM
exequor exequor is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 190 exequor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 51 sec
Reputation Power: 2
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?

Reply With Quote
  #2  
Old March 13th, 2004, 06:23 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: inserting date into date field

try using curdate() instead of now()...now() returns the date AND time, curdate just returns the date.

Reply With Quote
  #3  
Old March 13th, 2004, 07:16 PM
exequor exequor is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 190 exequor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 51 sec
Reputation Power: 2
RE: inserting date into date field

so can use now() if the field is DATETIME?

Reply With Quote
  #4  
Old March 13th, 2004, 08:59 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: inserting date into date field

Yes.

Reply With Quote
  #5  
Old March 14th, 2004, 04:58 PM
nemo nemo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Long Island, NY USA
Posts: 24 nemo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old March 26th, 2004, 01:06 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: inserting date into date field

Cheers for that suggestion Jim - saved me some time there!

Reply With Quote
  #7  
Old March 26th, 2004, 09:09 PM
nemo nemo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Long Island, NY USA
Posts: 24 nemo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: RE: inserting date into date field


Quote:
Cheers for that suggestion Jim - saved me some time there!


Glad I could help.

Have a great day
-Jim

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > inserting date into date field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway