title: Retrieve multiple checkbox and display other related information from database in a table
body: <p>I got this list of checkboxes that print out from database. I am able to retrieve data from database if user makes multiple checkbox and display it in table, but i cannot retrieved other information from database and display it in the same table.</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;table border='1'&gt;
  
  &lt;tr&gt;
  &lt;th&gt;TITLE&lt;/th&gt;
  &lt;th&gt;PERCENTAGE RESULT&lt;/th&gt;
  &lt;/tr&gt;
  
  &lt;?php 
  
  if(isset ($_POST["submit1"]))
  {
      $selectedcheckbox = $_POST["selectedcheck"];
  
      $query = "SELECT * FROM compareresult where subject=$selectedcheckbox";
     $sql_query = mysql_query($query) or die('Error 3 :'.mysql_error());
      while($data = mysql_fetch_array($sql_query,MYSQL_ASSOC)){
  
        $result=$data['result'];
      }
  
      foreach($selectedcheckbox as $title)
      {
  
         echo "&lt;tr&gt;";
          echo "&lt;td&gt;".$title."&lt;/td&gt;";
         echo "&lt;td&gt;".$result."&lt;/td&gt;";
      }           
          echo "&lt;/tr&gt;";
  
  }
  ?&gt;
  </code></pre>
  
  <p>I want to display result after user select multiple checkbox, so I wrote:</p>
  
  <pre><code> echo $result in table
  </code></pre>
  
  <p>so that the result can be displayed in table beside the selected title, but I am getting an error:</p>
  
  <blockquote>
    <p>Array to string conversion in C:\xampp\htdocs\sam\c.php on line 31 Error 3 :Unknown column 'Array' in 'where clause'</p>
  </blockquote>