Checkmark Array Fields in MySQL in DB

  • ellie123
    Asked on August 3, 2014 at 12:05 PM

    I have several Checkbox fields on my form in my database this just shows as "Array". What do I need to do on my Custom PHP page in order for this to show properly in my db?

    I tried this...

    $check=$_POST['check']['0'] .":". $_POST['check']['1'] ." ". $_POST['check']['2'];

    But I copied this from a time field, so I know my format is screwed up.

    Can you help me by showing me how I would format it for a question that has 3 options: YES, NO and OTHER?

    (My field name is: "check")

    Thank you,
    LB

     

  • Jeanette JotForm Support
    Replied on August 3, 2014 at 5:04 PM

    I think using http://www.jotform.com/show-post-data  as a Custom URL Thank you page to show your post data will easily help you to find out the correct keys for your form

    For example, I made this form and the script helps me find out the correct keys for the checkboxes I selected (in green)

    Data Submitted:
    Array ( [submission_id] => 282908641737556490 [formID] => 30155250445950 [ip] => 201.247.17.37 [fullname3] => Array ( [0] => Jeanette [1] => Bmz ) [email4] => jeanette@jotform.com [checkfor] => Array ( [0] => January [1] => March [2] => June ) )

    PHP Code:
    $_POST['submission_id'];
    $_POST['formID'];
    $_POST['ip'];
    $_POST['fullname3']['0'];$_POST['fullname3']['1'];
    $_POST['email4'];
    $_POST['checkfor']['0'];$_POST['checkfor']['1'];$_POST['checkfor']['2'];

     

    Please follow this complete guide for further details