how would I pull the data out of the database and re-check the checkboxes that were originally checked and submitted?
<p>I entered checkbox values into the database using the code below.  When a user wants to view the checked boxes at a later time, how would I pull the data out of the database and re-check the checkboxes that were originally checked and submitted?</p>

<p>From the code below the data gets entered like this: DATA1|DATA2|DATA3|</p>

<pre><code>var checkbox_value = "";
    $(":checkbox").each(function () {
        var ischecked = $(this).is(":checked");
        if (ischecked) {
            checkbox_value += $(this).val() + "|";
        }
    });
</code></pre>

<p>Now how to I take DATA1|DATA2|DATA3| and re-check the corresponding checkboxes?</p>

<p>Here is how I'm getting other data and re-displaying it from normal input text boxes: </p>

<pre><code>$.ajax({
  url: 'ajax/example/example.php',
  data: "findval="+carrier+"&amp;column="+column,
  dataType: 'json',                
  success: function(data)         
  {

    var auto_id = data['id'];
    var auto_name = data['name'];
    var auto_address = data['address'];
    var auto_trailer_types = data['trailer_types'];

$('#output_autocomplete_forms').html("&lt;form id='example' class='form-horizontal'&gt;&lt;input type='hidden' name='auto_id' id='auto_id' class='form-control' value="+auto_id+"&gt;......&lt;div class='form-group'&gt;
&lt;div class='checkbox'&gt;&lt;label&gt;&lt;input type='checkbox' name='trailer_kinds[]' value='DATA1'&gt;DATA1&lt;/label&gt;&lt;/div&gt;
&lt;div class='checkbox'&gt;&lt;label&gt;&lt;input type='checkbox' name='trailer_kinds[]' value='DATA2'&gt;DATA2&lt;/label&gt;&lt;/div&gt;
&lt;div class='checkbox'&gt;&lt;label&gt;&lt;input type='checkbox' name='trailer_kinds[]' value='DATA3'&gt;DATA3&lt;/label&gt;&lt;/div&gt; 
</code></pre>

<p>var auto_trailer_types = data['trailer_types'];</p>

<p>Now how do I take DATA1|DATA2|DATA3| and re-check the corresponding checkboxes?</p>