title: How to insert ö/ä/ü in Database using php utf8
body: <p>It was asked a dozen times, I know, but the only thing I want is to insert a German letter like 'Ä' into a database using a php script which simply doesn't work using the existing solutions.</p>
  
  <pre><code>&lt;?php
  header('Content-type: text/html; charset=utf-8'); 
  $con = mysqli_connect("localhost", "username", "password");
  
  mysqli_set_charset($con, "utf8mb4");
  mysqli_select_db($con, "database");
  mysqli_query($con, "SET SESSION CHARACTER_SET_RESULTS =utf8mb4;");
  mysqli_query($con, "SET SESSION CHARACTER_SET_CLIENT =utf8mb4;");
  mysqli_query($con, "SET NAMES 'utf8mb4';");
  
  mysqli_query($con,
  "SET character_set_results = 'utf8',
  character_set_client = 'utf8',
  character_set_connection = 'utf8',
  character_set_database = 'utf8',
  character_set_server = 'utf8';");
  
  $title = 'Ö';
  $result = mysqli_query($con, 
  "INSERT INTO Test (Title)
  VALUES ('" . utf8_encode($title) . "');");
  #Doesn't work, this was inserted: Ã
  ?&gt;
  </code></pre>
  
  <p>The charset of the column 'Title' is set to utf8mb4_general_ci and of the Table itself its utf8_general_ci.
  MySQL Server version is  5.5.31
  MySQL Charset is UTF-8 Unicode</p>
  
  <p>Does anybody know what I am doing wrong or am I missing something here?</p>