Jump to content


Photo

Making One Value From Many


  • Please log in to reply
2 replies to this topic

#1 PWD

PWD
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 07 March 2006 - 03:24 AM

Currently developing a GUI where my client can add important dates to their calendar. The info. is stored in a MySQL table where the field attribute is set to DATE.

I have 3 select boxes. 1 for the Month, 1 for the Day and 1 for Year. When submitted, I need to make their choices into one; international date format.

Here is what I have so far:

$impdate = $_POST['impyear'] . $_POST['impmonth'] . $_POST['impday'];

Let's say they have April 1 2006 selected. As my script stands, when echo'd it produces the following:

200641

My PROBLEM: How do I get the dashes in there also so MySQL recognizes it as a valid date format:

2006-4-1

My gratitude ahead of time!


[!--fonto:Geneva--][span style="font-family:Geneva"][!--/fonto--]My Gratitude---[!--fontc--][/span][!--/fontc--]
(My gratitude in advance for helping me learn; so I may one day give as freely as you have here today)
----------
[!--sizeo:5--][span style="font-size:18pt;line-height:100%"][!--/sizeo--][!--fonto:Optima--][span style="font-family:Optima"][!--/fonto--][!--coloro:red--][span style="color:red"][!--/coloro--]PWD[!--sizec--][/span][!--/sizec--][!--colorc--][/span][!--/colorc--][!--fontc--][/span][!--/fontc--]

#2 insrtsnhere13

insrtsnhere13
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 07 March 2006 - 03:30 AM

i think it would be something like

$year."-".$month."-".$day


#3 PWD

PWD
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 07 March 2006 - 03:33 AM

You are the...PERSON!

My gratitude for helping me learn...(bows gracefully)
[!--fonto:Geneva--][span style="font-family:Geneva"][!--/fonto--]My Gratitude---[!--fontc--][/span][!--/fontc--]
(My gratitude in advance for helping me learn; so I may one day give as freely as you have here today)
----------
[!--sizeo:5--][span style="font-size:18pt;line-height:100%"][!--/sizeo--][!--fonto:Optima--][span style="font-family:Optima"][!--/fonto--][!--coloro:red--][span style="color:red"][!--/coloro--]PWD[!--sizec--][/span][!--/sizec--][!--colorc--][/span][!--/colorc--][!--fontc--][/span][!--/fontc--]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users