PDA

View Full Version : Another INSERT question! (dates)


rattlsnak
08-18-2008, 06:12 AM
On my HTML form used to INSERT data, I have built a drop down list for the date that contains 3 pull down boxes for the D, M and Y. I'm confused on how to use those values for an INSERT as it appears to be three inputs, but I only have one field in my database for date.

How can I use the three values for one input?
Thanks..

davidj
08-18-2008, 07:51 AM
you need to concatenate them



$D = $_POST['D'];
$M = $_POST['M'];
$Y = $_POST['Y'];

$fulldate = $Y."-".$M."-".$D;


so $fulldate == a formatted date

use the . to concatinate variables and strings together

rattlsnak
08-18-2008, 02:59 PM
AWESOME!
Thanks.. :)

I can feel SOME of my nOObness is fading!

davidj
08-18-2008, 03:03 PM
it gets easier but your constantly learning new stuff