Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 04-25-2009, 11:46 AM Put date into MySql
fog
fog's Avatar
Experienced Talker

Posts: 47
Location: Florida
Trades: 0
I am a complete newbe, I am inserting a record into a MySql db from a form on a Dreamweaver page. The form has only two fields, zip code and email. I setup table in the db to have five fields, an id number, zip code, email and date. I would like the date to reflect the date the record was inserted into the db. How would I do that?

Thanks for any help.
fog is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-25-2009, 05:53 PM Re: Put date into MySql
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
if yout date colum is in a datetime or timestamp format, use the sql function "now()"
Code:
insert into myTable (dateCol) values ( now() );
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-25-2009, 06:00 PM Re: Put date into MySql
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Also, depending on how your field is set up, if the default is CURRENT_TIMESTAMP, you can just insert NULL, and it will be automatically handled for you.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-26-2009, 01:59 PM Re: Put date into MySql
fog
fog's Avatar
Experienced Talker

Posts: 47
Location: Florida
Trades: 0
Thank you for the suggestions, I found the timstamp field and that worked perfect.
fog is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Put date into MySql
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29633 seconds with 12 queries