PHP to mySQL date format conversion
I am newbie to PHP/mySQL but have managed to make some headway using various books on the subject. I am trying to make a form page that my clients can access to update the 'events' table in thier site's database.
I have created the database using phpMyAdmin, no problem. I have connected to it, sorted the results of the queries and formatted the data into a nice HTML table etc... works fine.
Now I am trying to create a form that puts the event information into the database.
I am having a problem getting the date info in the correct format. I want the date information to be entered via a dropdown menu (month, day, year) generated by php on the addEvent.php page.
I am getting each of the month, day and year as separate values:
$month (01-12)
$day (01-31)
$year (2004-2014);
how can I combine these variables into a format that I can pop into the DB, then query, sort, and format as a date type with mySQL?
|