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

    Viewing multiple checkbox in multiple columns in the database using PHP

    Asked by smit on November 07, 2015 at 08:51 AM

    how to view multiple checkbox values in multiple column in database using php

    this is my code

    <?php

    include('config.php');

     

    //echo '<pre>';print_r($_POST);

     

    //echo sizeof($_POST['size_name']);

     

    if(isset($_POST['submit']))

    $data[]=array("id"=>0,"application_name"=>"","range_name"=>"","size_name"=>"","image"=>"");

     

    if(isset($_POST['size_name']))

    {   

    $val=$_POST['size_name'];

    for($i="0";$i<sizeof($val);$i++)

    {

    $seldata=mysql_query("select * from tiles where size_name='".$val[$i]."'")or die(mysql_error());

    while($data1=mysql_fetch_assoc($seldata))

    {

    $data[]=$data1;

    }

    }

    }

     

    if(isset($_POST['application_name']))

    {   

    $val=$_POST['application_name'];

    for($i="0";$i<sizeof($val);$i++)

    {

    $seldata=mysql_query("select * from tiles where application_name='".$val[$i]."'")or die(mysql_error());

    while($data2=mysql_fetch_assoc($seldata))

    $nm=$i+1;

    if(($data2['id']!=$data[$nm]['id']) && ($data[$nm]!="0"))

    {

    $data[]=$data2; 

    }

    }

    }

     

    }

    if(isset($_POST['range_name']))

    {   

    $val=$_POST['range_name'];

    for($i="0";$i<sizeof($val);$i++)

    {

    $seldata=mysql_query("select * from tiles where range_name='".$val[$i]."'")or die(mysql_error());

    while($data3=mysql_fetch_assoc($seldata))

    {

    $nm=$i+1;

    if(($data3['id']!=$data[$nm]['id'])  && ($data[$nm]!="0"))

    {

    $data[]=$data3; 

    }

     

    }

     

    }

    }

     

     

    unset($data["0"]);

    echo '<pre>';print_r($data);

    checkbox database SQL PHP API
  • Profile Image
    JotForm Support

    Answered by Jan on November 07, 2015 at 09:04 AM

    You might need to hire a developer in order to configure or modify your SQL database in order to display multiple check boxes. 

    Please check our API page to know more connecting your form to a database. You can also check our Webhooks about connecting apps or sending data.

    Hope that helps. Thank you.