Results 1 to 4 of 4
Thread: Combine Date Variables
-
07-25-2005, 10:34 AM #1Junior Guru Wannabe
- Join Date
- Mar 2004
- Location
- NOLA
- Posts
- 41
Combine Date Variables
I have a simple form passing the date selected from drop downs. In my database the date format is YYYY-MM-DD. I have set the posted variables to $year, $month, and $date. What is the best way to combine these variables to submit correctly to the database? Thanks in advance :-)
-
07-25-2005, 10:41 AM #2Junior Guru Wannabe
- Join Date
- Mar 2004
- Location
- NOLA
- Posts
- 41
Got it..just needed quotes around the variables..
$eventDate = "$year-$month-$day";
-
07-25-2005, 12:35 PM #3Web Hosting Evangelist
- Join Date
- Mar 2005
- Posts
- 514
just so you know, there are a few ways of doing it... i belive
$eventDate = "$year-$month-$day";
$eventDate = <<<EOT
$year-$month-$day
EOT;
$eventDate = $year."-".$month."-".$day;
Wouyld all do it, a lto depends on your 'style' or codingNote to self: Add something funny!
Search is your friend!
-
07-25-2005, 12:46 PM #4Junior Guru Wannabe
- Join Date
- Mar 2004
- Location
- NOLA
- Posts
- 41
thanks for the tips