Results 1 to 2 of 2

Thread: How to convert a string to date?
      
   

  1. #1
    useruser888 is offline Corporal
    Join Date
    Jan 2010
    Posts
    14

    Default How to convert a string to date?

    Hi:

    I am confused with the date field. I have the following html code for a birthdate, and I want to same it to a date field in a table:
    <td>Birth Date: <input type="text" name="birthdate" size="8" maxlength="8"> ex. 19910101</td
    ....
    mysql_query("INSERT INTO studentname (birthdate) values ('$_POST[birthdate]')";

    Now I got error saying:

    Error: Incorrect date value: '20000212'

    Please help to fix it. Should I do some conversion? How do I do it?

    Thank you for your help.

  2. #2
    useruser888 is offline Corporal
    Join Date
    Jan 2010
    Posts
    14

    Default Re: How to convert a string to date?

    Thank you, I fixed the problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49