944,126 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 12742
  • PHP RSS
Jun 25th, 2007
0

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

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gllanci is offline Offline
2 posts
since Jun 2007
Jun 25th, 2007
0

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

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

I.e '2006-01-02'
Last edited by iamthwee; Jun 25th, 2007 at 2:45 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 25th, 2007
0

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

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.)
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004
Jun 26th, 2007
0

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

my problem is with adding and updates.

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


thnx
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gllanci is offline Offline
2 posts
since Jun 2007
Jun 26th, 2007
0

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

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.
Last edited by iamthwee; Jun 26th, 2007 at 3:10 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: CMS - I don't quite get it???
Next Thread in PHP Forum Timeline: Sessions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC