title: How to insert multiple data into one column
body: <p>I tried to insert the data student name 'Dhiya' and 'Siti' and $checkbox into the database. I recall the data first from table student_course in the database. I checked Presence for both name. Here is the code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;div class="container"&gt;
  &lt;div class="content"&gt;
  &lt;?php
  include ('system2.php');
  include('connect_database.php');
  $course = $_POST['course'];
  $batch = $_POST['batch'];
  $group = $_POST['group'];
  $student_name = $_POST['Student_Name'];
  $checkbox = $_POST['checkbox'];
  $query_view1 = mysql_query("SELECT distinct Student_Name FROM student_course where batch='12/01'");
  $query_view2 = mysql_query("SELECT distinct Student_Name FROM student_course where batch='12/02'");
  
  echo "&lt;form action ='system23.php' method = 'post'&gt;";
  echo "&lt;table border = '1' align='center'&gt;";
  echo "&lt;tr&gt;
      &lt;th&gt;&lt;font color=#555555&gt;Name&lt;/font&gt; &lt;/th&gt;
      &lt;th&gt;&lt;font color=green&gt;Presence&lt;/font&gt; &lt;/th&gt;
      &lt;th&gt;&lt;font color=red&gt;Absence&lt;/font&gt; &lt;/th&gt;
      &lt;th&gt;&lt;font color=#FFCC00&gt;Permission&lt;/font&gt; &lt;/th&gt;
      &lt;th&gt;&lt;font color=purple&gt;Late&lt;/font&gt; &lt;/th&gt;
   &lt;/tr&gt;";
  
  if ($batch=='12/01')
  {
      while($row = mysql_fetch_array($query_view1) )
      {
          echo "&lt;tr&gt;";?&gt;
          &lt;td&gt;&lt;input type="text" name="stuname" value="&lt;?php echo $row['Student_Name']?&gt;"/&gt;&lt;/td&gt;
          &lt;?php
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='P'/&gt;&lt;/td&gt;";
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='A'/&gt;&lt;/td&gt;";
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='PR'/&gt;&lt;/td&gt;";
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='L'/&gt;&lt;/td&gt;";
          echo "&lt;/tr&gt;";
      }
  }
  else if ($batch=='12/02')
  {
      while($row = mysql_fetch_array($query_view2) )
      {
          echo "&lt;tr&gt;";?&gt;
          &lt;td&gt;&lt;input type="text" name="stuname" value="&lt;?php echo $row['Student_Name']?&gt;"/&gt;&lt;/td&gt;
          &lt;?php
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='P'/&gt;&lt;/td&gt;";
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='A'/&gt;&lt;/td&gt;";  
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='PR'/&gt;&lt;/td&gt;";
          echo "&lt;td&gt;&lt;input type='checkbox' name='checkbox' value='L'/&gt;&lt;/td&gt;";
          echo "&lt;/tr&gt;";
      }
  }   
  echo "&lt;tr&gt;";
  echo "&lt;td colspan='6' align='center'&gt;&lt;input name='submit' type='submit' value='GO' /&gt;&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  echo "&lt;/table&gt;";
  echo "&lt;/form&gt;"; 
  ?&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then i tried to insert the data into the database. Here's the code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;div class="container"&gt;
  &lt;?php
  include ('system22.php');
  include('connect_database.php');
  $checkbox = $_POST['checkbox'];
  $query_view1 = mysql_query("SELECT distinct Student_Name FROM student_course where batch='12/02'");
  $query_view2 = mysql_query("SELECT distinct Student_Name FROM student_course where batch='12/02'");
  $student_name = $_POST['stuname'];
  $batch= $_POST['batch'];
  mysql_query ("INSERT INTO result2 VALUES ('$student_name', '$checkbox')");
  echo "Success";
  ?&gt;
  &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But when i check the database, it only put 'Siti'. I don't know what other methods to use</p>
  
  <p>Since  i can't post the image, i will try to make it as clear as possible</p>
  
  <p>The table of student_course</p>
  
  <pre><code>&lt;html&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;1&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Siti&lt;/td&gt;
              &lt;td&gt;P&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>For table result2 structure.</p>
  
  <p><strong>Field</strong>: 'Name' and '1'
  <strong>Type</strong>: both varchar(99).
  No primary and foreigh key.</p>