Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple date allocation

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
Hi all

im trying to allocate three variables to the Datetime stamp in mysql and have tried a few version, here is the code i am using now

$dob = date($year-$month-$date h:i:s);

however it dont work..

Sorry to keep asking but im learning the details on the date variable..

can any one help me allocate the three variables to the date funtion. so that the date that is produces is the date in the variables

cheers
 
If all you're doing is using the three variables $year, $month, and $date, to create a date to insert into a mysql database, you probably don't need the date() function. Try:
Code:
$dob = $year . '-' . $month . '-' . $date;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top