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

Reply

Join Date: Jun 2007
Posts: 2
Reputation: gllanci is an unknown quantity at this point 
Solved Threads: 0
gllanci gllanci is offline Offline
Newbie Poster

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

 
0
  #1
Jun 25th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

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

 
0
  #2
Jun 25th, 2007
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.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

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

 
0
  #3
Jun 25th, 2007
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.)
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 2
Reputation: gllanci is an unknown quantity at this point 
Solved Threads: 0
gllanci gllanci is offline Offline
Newbie Poster

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

 
0
  #4
Jun 26th, 2007
my problem is with adding and updates.

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


thnx
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

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

 
0
  #5
Jun 26th, 2007
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.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC