title: How to insert the string data from PHP into MySql table
body: <p>How to insert these string data from PHP into MySQL table, I can get the code running but it not inserting into database.</p>
  
  <p>The php code:</p>
  
  <pre><code>&lt;?php
  
  //mysql connection
  $connect_error = 'Sorry, the database server is down. Please try again later.';
  mysql_connect('xxxxxxxxx.com', 'xxxxxxx', 'xxxxxxxxx') or die($connect_error);
  mysql_select_db('checkbox_test') or die($connect_error);
  
  if (isset($_POST['submit'])) {
      if (isset($_POST['subject'])) {
          $strsubject = implode(",", ($_POST['subject']));
      } else {
          $strsubject = "";
      }
  
      echo $strsubject;
  }
  
  mysql_query("INSERT INTO levels (level_1, level_2, level_3, level_4, level_5, level_6) VALUES ($strsubject");
  ?&gt;
  </code></pre>
  
  <p>The html:</p>
  
  <pre><code>&lt;form action="" method="post" name="form_subject" id="form_subject"&gt;
  
      &lt;input type="checkbox" name="subject[]" value="level_1"&gt;&lt;label&gt;Level 1&lt;/label&gt;&lt;p&gt;    
      &lt;input type="checkbox" name="subject[]" value="level_2"&gt;&lt;/label&gt;Level 2&lt;/label&gt;&lt;p&gt;  
      &lt;input type="checkbox" name="subject[]" value="level_3"&gt;&lt;/label&gt;Level 3&lt;/label&gt;&lt;p&gt;   
      &lt;input type="checkbox" name="subject[]" value="level_4"&gt;&lt;label&gt;Level 4&lt;/label&gt;&lt;p&gt;    
      &lt;input type="checkbox" name="subject[]" value="level_5"&gt;&lt;/label&gt;Level 5&lt;/label&gt;&lt;p&gt;       
      &lt;input type="checkbox" name="subject[]" value="level_6"&gt;&lt;/label&gt;Level 6&lt;/label&gt;&lt;p&gt;
  
      &lt;input type="submit" action= "" name="submit"  value="Submit" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>The database table has 7 columns, 1 for id (set to A_I) and the rest named for each level.
  I'm new to web developing, thanks guys </p>