title: how to retrieve Checkbox checked event stored in database
body: <p>I am just missing few line of code in my project. I have checkboxes and submit button. User clicked in the checkbox and on click he will filter the the options. I am storing checkboxes checked result into database as a serialize array and the retreving it as a unserialize array so i am getting the filter checkbox result properly whenever i refresh the page. The only problem is my checkboxes are not showing checked when i refresh the page. It showing the result properly and stored into database but i am not able to maintain the checkbox event. I think i am missing 1 line of code in html input type.My unserialize array are stored in $config variable.
  Here is my code:
  html code:</p>
  
  <pre><code>    if($param['aktion'] == 'get-widget-vehicle-edit')
  {
      $page['register-fahrzeuge'] = array(
          0   =&gt; array( 'FAHRZEUGE','enabled',$page['script'],''),
          1   =&gt; array( 'EDIT-FAHRZEUGE','aktiv',$page['script'],'',''),  
      );
  
      $html = '&lt;table width="538" cellspacing="0" cellpadding="0" border="0"&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;div&gt;'.CreateRegister($page['register-fahrzeuge']).'&lt;/div&gt;
                      '.CreateMessage().'
                      &lt;div class="cont-liste-verlauf register"&gt;
                          &lt;table id="FAHRZEUGE" &gt;
                              &lt;tr&gt;
                                  &lt;td&gt;';
      &lt;table id="FAHRZEUGE" &gt;
                                  &lt;tr&gt;
                                      &lt;td&gt;
                                      &lt;input type="checkbox" name="Anzahl_Fahrzeuge_ohne_Bilder" id="Anzahl_Fahrzeuge_ohne_Bilder" checked /&gt;
                                      &lt;label for="Anzahl_Fahrzeuge_ohne_Bilder"&gt;Anzahl_Fahrzeuge_ohne_Bilder&lt;/label&gt;&lt;br&gt;
  
                                      &lt;input type="checkbox" name="Fahrzeuge_ohne_Preis" id="Fahrzeuge_ohne_Preis" value="Fahrzeuge_ohne_Preis" checked /&gt;
                                      &lt;label for="Fahrzeuge_ohne_Preis"&gt;Fahrzeuge_ohne_Preis&lt;/label&gt;&lt;br&gt;
  
                                      &lt;input type="checkbox" name="Fahrzeuge_mit_Fehlern" id="Fahrzeuge_mit_Fehlern" value="Fahrzeuge_mit_Fehlern" checked /&gt;
                                      &lt;label for="Fahrzeuge_mit_Fehlern"&gt;Fahrzeuge_mit_Fehlern&lt;/label&gt;&lt;br&gt;
  
                          &lt;input type="checkbox" name="Herausforderungen" id="Herausforderungen" value="Herausforderungen" checked /&gt;
                                      &lt;label for="Herausforderungen"&gt;Herausforderungen&lt;/label&gt;&lt;br&gt;&lt;br&gt;                
  
                              &lt;/td&gt;
                          &lt;/tr&gt;
                              &lt;/table&gt;
  $html .= '&lt;/td&gt;
                      &lt;/tr&gt;
                          &lt;/table&gt;
                          '.CreateButton($page['button']).'
                      &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;';
  
      $return = array(
          'status' =&gt; 1,
          'html'  =&gt; $html
      );
  
      echo json_encode($return);
      die();
  }
  </code></pre>
  
  <p>php code :</p>
  
  <pre><code>    if($param['aktion'] == 'get-widget-vehicle')
  {
      $page['register-fahrzeuge'] = array(
          1   =&gt; array( 'FAHRZEUGE','aktiv',$page['script'],''),
          0   =&gt; array( 'EDIT-FAHRZEUGE','enabled',$page['script'],'',''),    
      );        
  
              /*when empty default config...
              $query=    "SELECT dashboard_widget.configuration FROM dashboard_widget WHERE Id =1"; 
              */ 
  
             $query ="SELECT dashboard_widget_users.configuration
                                           FROM dashboard_widget_users
                                           INNER JOIN yw_user ON dashboard_widget_users.dsnr_yw_user = yw_user.intern
                                           INNER JOIN dashboard_widget ON dashboard_widget_users.dsnr_dashboard_widget = dashboard_widget.id
                                           WHERE dashboard_widget_users.dsnr_yw_user=".$user_id." AND dashboard_widget.id=1 ";  
                      $result = mysql_query($query, $myConnection);               
  
  
          $html = '&lt;table width="538" cellspacing="0" cellpadding="0" border="0" &gt;
              &lt;tr&gt;
                  &lt;td&gt;
                  &lt;div&gt;'.CreateRegister($page['register-fahrzeuge']).'&lt;/div&gt;
                  '.CreateMessage().'
                  &lt;div class="cont-liste-verlauf register"&gt;';
                      if($row = mysql_fetch_assoc($result)) 
                      {
                          $empty_config=$row['configuration'];
                          if(empty($empty_config )) {
                              $sql="SELECT dashboard_widget.configuration FROM dashboard_widget WHERE Id =1";
                              $sql_result = mysql_query($sql, $myConnection);
                              $results = mysql_fetch_assoc($sql_result);  
                              $config= unserialize($results['configuration']);                            
                          }
                          else{
                          $config= unserialize($row['configuration']);
                          }
  
                          foreach($config as $val)
                          {
                              if($val == 'Anzahl_Fahrzeuge_ohne_Bilder')
                              {
  
                                  $sql='SELECT count( * ) as bilder FROM autodo.amo_bilder_live l LEFT JOIN autodo.afzdaten a ON l.dsnr_afzdaten = a.dsnr WHERE l.dsnr_afzdaten IS NULL';
                                  $sql_result=mysql_query($sql);
                                  $results=mysql_fetch_assoc($sql_result); 
                                  $configVehicleWidget[$val]['count'] = $results['bilder'];
  
                              }
                              else if($val == 'Fahrzeuge_ohne_Preis')
                              {
                                  $sql='SELECT count(*) as Preis FROM autodo.afzdaten WHERE Preis IS NULL';
                                              $sql_result=mysql_query($sql);
                                              $results=mysql_fetch_assoc($sql_result);
                                              $configVehicleWidget[$val]['count'] = $results['Preis'];
                              }
                              else if($val == 'Fahrzeuge_mit_Fehlern')
                              {
                                  $sql='SELECT count(*) as fehler FROM autodo.afzdaten WHERE fehler IS NULL';
                                  $sql_result=mysql_query($sql);
                                  $results=mysql_fetch_assoc($sql_result);
                                  $configVehicleWidget[$val]['count'] = $results['fehler'];
  
                              }
                              else if($val == 'Herausforderungen')
                              {
                                  $sql='SELECT count(*) as herausforderung FROM autodo.afzdaten WHERE herausforderung IS NULL'; 
                                  $sql_result=mysql_query($sql);
                                  $results=mysql_fetch_assoc($sql_result);
                                  $configVehicleWidget[$val]['count'] = $results['herausforderung'];
                              }                       
  
                              if($configVehicleWidget[$val]['count'] &gt; 0)
                              {
                                  $html .= '&lt;a href="'.$configVehicleWidget[$val]['link'].'" style="color:red;"&gt;'.'&lt;image src="'.$configVehicleWidget[$val]['image'].'" width="30" height="25" align="middle"&gt;.'.$configVehicleWidget[$val]['count'].' '.$configVehicleWidget[$val]['linkName'].'&lt;br&gt;'.'&lt;br&gt;'.'&lt;/a&gt;';
                              }
                              else
                              {
                                  $html .='&lt;span style="color:green;"&gt;'.'&lt;image src="'.$configVehicleWidget[$val]['image'].'" width="30" height="22" align="middle"&gt;.'.$configVehicleWidget[$val]['textAllOK'].'&lt;br&gt;'.'&lt;br&gt;'.'&lt;/span&gt;';
                              }                           
                      }
                  }
  
                  $html .= '              
              &lt;/div&gt;          
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;';
  
      $return = array(
          'status' =&gt; 1,
          'html'  =&gt; $html
      );
  
      echo json_encode($return);
      die();
  }
  </code></pre>