HighDots Forums  

PHP Putting a date back into MySql

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss PHP Putting a date back into MySql in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JustMeDavid
 
Posts: n/a

Default PHP Putting a date back into MySql - 07-07-2004 , 08:49 AM






Hi

I am a newbee. using Dreamweaver MX - PHP and MySql Database

I have an Insert record form with a date_submitted field.
When I submit a date "07/07/04" or "07/07/2004" it works ok but the date
stored is not correct.

When I display a date, I searched and found an example for the Date text box.
echo date("dS M Y",strtotime($row_news_rs['Submit_date'])); = "07th July 2004"

But when I save a record the date stored is not correct.

I did search again but but with no luck

Thanks in advance




Reply With Quote
  #2  
Old   
gareth
 
Posts: n/a

Default Re: PHP Putting a date back into MySql - 07-07-2004 , 10:35 AM






PHP uses the date format yyyy-mm-dd, so you need to convert the date to this
format before you insert it into a MySQL date field.


--
Gareth
http://www.garethdp.com/
Buzz inet - http://www.buzzinet.co.uk/

Team Macromedia Volunteer for Dreamweaver MX
Dreamweaver MX Support: http://www.dreamweavermxsupport.com/index.php

PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
http://www.dreamweavermxsupport.com/extensions/

Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
Co-Author: Practical Intranet Development - Apress
Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
Co-Author: Dreamweaver MX: PHP Web Development - Wrox



Reply With Quote
  #3  
Old   
JustMeDavid
 
Posts: n/a

Default Re: PHP Putting a date back into MySql - 07-07-2004 , 11:33 AM



Thanks for your quick reply

David

Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.