954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Date Field in MySQL with PHP /add/edit/delete

Hello

Im makineg a small cms for my purposes and my problem is updating adding dhe DATE, im getting 00.00.0000

can anybody help me making a drop down date with dd/mm/YYYY so I can add - edit ??


Thnx a lot
Enjoy Life

gllanci
Newbie Poster
2 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Are you inserting the dates using single quotes? Dates in mysql go yyyymmdd.

I.e '2006-01-02'

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

See also:
http://www.daniweb.com/forums/thread81362.html

http://www.php.net/manual/en/function.date.php

The link to php.net is probably the more useful one for your situation. If you look in the comments, there's a snippet that shows how to format the date and time to MySQL's liking. (It works well, I've used it extensively.)

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

my problem is with adding and updates.

can anybody give me any example. with any drop down date selectror.??


thnx

gllanci
Newbie Poster
2 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

The best way to test if you're adding dates correctly is to open up mysql and do it from there, at the command prompt.

Then echo it out. If all that's ok then its look at your php for the problems.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You