Inserting future date into mysql from a form
Posted: Sun May 20, 2007 5:56 pm
I have a problem with a date insertion. I am quite new to PHP and mySQL and this is the first problem I have come up against.
I wish for a user to insert events into a form... all the other requests for info will write to their respected areas and have no problem being pulled back out, except the event date...
The code I am using inside the form is this:
<input size="40" name="eventdate"
value="<?php echo date($story['eventdate']);?>">
but the result is always 0000-00-00 as the date entered will not write to the database...
What I need is for the date to be entered in this format so that I can use the date to return a search query so that all entries will display date ascending (or descending).
The Sql $eventdate is set to date, and value is 0000-00-00... the right date can be entered through the phpmyadmin built in calender, but not through the form.
Any help will be received with great thanks,
Fridge
I wish for a user to insert events into a form... all the other requests for info will write to their respected areas and have no problem being pulled back out, except the event date...
The code I am using inside the form is this:
<input size="40" name="eventdate"
value="<?php echo date($story['eventdate']);?>">
but the result is always 0000-00-00 as the date entered will not write to the database...
What I need is for the date to be entered in this format so that I can use the date to return a search query so that all entries will display date ascending (or descending).
The Sql $eventdate is set to date, and value is 0000-00-00... the right date can be entered through the phpmyadmin built in calender, but not through the form.
Any help will be received with great thanks,
Fridge