Ask a Question related to PHP Development, Design and Development.
-
Dan Anderson #1
Re: [PHP] Please Help !
> I know this is really basic but i have a form for users to enter the
Read up in the manual of mySQL, and the parts of the PHP doc on mySQL.> date of an event that i would like to store in a mysql database how do i
> get the users input into the database in the right format.
mySQL dates are stored YYYY-MM-DD.
-Dan
Dan Anderson Guest
-
Sean O'Reilly #2
Please Help !
Hi,
I know this is really basic but i have a form for users to enter the
date of an event that i would like to store in a mysql database how do i
get the users input into the database in the right format.
Sean O'Reilly Guest
-
Anthony #3
Re: Please Help !
look up two functions in the online manual. strtotime() and date()
strtotime will give you a unix timestamp for just about any date possable,
date will format it the way you need. to get it into a mySQL date field,
basicaly, you do this:
date("y-m-d", strtotime($_POST['date']))
where $_POST['date'] is whatever variable you used.
- Anthony
"Sean O'Reilly" <s.oreilly@sussexcoast.co.uk> wrote in message
news:1057675256.17432.55.camel@sean.linnovations.c o.uk...> Hi,
>
> I know this is really basic but i have a form for users to enter the
> date of an event that i would like to store in a mysql database how do i
> get the users input into the database in the right format.
>
>
>
Anthony Guest



Reply With Quote

