Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-22-2004, 03:41 PM   PM User | #1
niko
New to the CF scene

 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
niko is an unknown quantity at this point
Date

What is the best way to insert a date field into a mysql database through PHP,

ive tried DATE()

and <?php echo date("j/n/y h:i a");?>

however sometimes these dont work right.
niko is offline   Reply With Quote
Old 04-22-2004, 06:17 PM   PM User | #2
sad69
Senior Coder

 
Join Date: Feb 2004
Posts: 1,206
Thanks: 0
Thanked 0 Times in 0 Posts
sad69 is an unknown quantity at this point
Check this out:
http://www.tek-tips.com/gviewthread....434/qid/808535

Sadiq.
sad69 is offline   Reply With Quote
Old 04-22-2004, 09:16 PM   PM User | #3
SDP2006
Regular Coder

 
Join Date: May 2003
Location: 34° 54' N 82° 13' W
Posts: 996
Thanks: 0
Thanked 0 Times in 0 Posts
SDP2006 is an unknown quantity at this point
I think MySQL has a TIMESTAMP field type.

http://dev.mysql.com/doc/mysql/en/DATETIME.html
__________________
Stevie Peele
Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
#dev - any programming,etc. question
#design - design discussion and critque
#central - general chat
Come join us!
SDP2006 is offline   Reply With Quote
Old 04-22-2004, 11:26 PM   PM User | #4
sidney
Regular Coder

 
Join Date: Mar 2004
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
sidney is an unknown quantity at this point
if you want the date time at the time of inserting try now()
sidney is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:16 PM.


Advertisement
Log in to turn off these ads.