What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How can I insert the date into only one field in my MySQL

    Asked by verex18 on December 31, 2012 at 02:38 AM

     I wanted to insert the date into my SQL database using your form,  but I can only insert it into different field in my database. Is there any way to insert the date into only one field in my database and able to retrieve the data back into my form.

  • Profile Image
    JotForm Support

    Answered by Welvin on December 31, 2012 at 03:45 AM

    Hi,

    Using our date field and following the guide given on this page (http://www.jotform.com/help/126-How-to-Insert-Update-Submissions-to-Your-MySQL-Database-Using-PHP), you can accomplish such thing. Are you NOT able to create a table on your MySQL database for only the date field? 

     

    Thanks

  • Profile Image

    Answered by verex18 on December 31, 2012 at 09:04 PM

    Using your datetime, how to submit the date into only one field in my database, because the date  are separated into 3 different fields right ? Right now what I want is to insert the field into only one field in my database instead of 3 different field

  • Profile Image
    JotForm Support

    Answered by liyam on January 01, 2013 at 12:43 AM

    You can merge the array keys and put it into one variable.

    Example:

    [DateTime] => Array ( [0] => 11 [1] => 24 [2] => 2013 [3] => 1 [4] => 34 [5] => PM )

    Your PHP code:

    $datetime = $_POST['DateTime']['2'] ."-". $_POST['DateTime']['0'] ."-". $_POST['DateTime']['1'] ." ". $_POST['DateTime']['3'] .":". $_POST['DateTime']['4'];

    This will make the value of the variable to:

    $datetime = "2012-11-24 1:34"

    Please let us know if you need further clarification.

    Thanks.