title: PHP and MySQL special characters error
body: <p>I am trying to make an article poster that works perfectly until I put special characters in the html form (like <code>;,!</code> etc.). I Googled it and found something about the table collation (which is <code>utf8_unicode_ci</code> by default).</p>
  
  <p>I have <code>&lt;meta charset="utf-8"&gt;</code> into the header file and <code>mysqli_set_charset($conn, 'utf8')</code> after connection to the database. Also the form has <code>accept-charset="utf-8"</code> attribute.</p>
  
  <p>Here is what happens after sending the form:</p>
  
  <pre><code>if(isset($_POST['sendForm']))
  {
      $articleTitle = $_POST['title'];
      $articleText = $_POST['text'];
      $name = $_SESSION['name'];
  
      $currentDateMySQL = date("Y.m.d");
  
      $sql = "INSERT INTO articles (title, text, owner, date_added) VALUES ('$articleTitle', '$articleText', '$name', '$currentDateMySQL')";
  $result = mysqli_query($conn, $sql);
  
      if($result === false)
      {
          $color = "red";
          $infoText = "Could not insert your information into the database. Error number: &lt;b&gt;" . mysqli_errno($conn) . "&lt;/b&gt;. :( Try again.";
      }
      else
      {
          $color = "green";
          $infoText = "Succesfully writen the article into the database. :)";
      }
  }
  </code></pre>
  
  <p>Also the given error number is <code>1064</code>. There is no error in the SQL code, it works perfectly without special characters.</p>