title: php + ajax insert query is coded when cyrillic is used
body: <p>I've got ajax query which is linked to php script that inserts into table input values. This php script looks like this:</p>
  <pre><code>&lt;?php
  $servername = &quot;localhost&quot;;
  $username = &quot;root&quot;;
  $password = &quot;&quot;;
  $dbname = &quot;DB&quot;;
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
    die(&quot;Connection failed: &quot; . $conn-&gt;connect_error);
  }
  
  $dt_add = $_POST['dt_add'];
  $name = $_POST['name'];
  $domain = $_POST['domain'];
  $cat = $_POST['cat'];
  $webmaster_id = $_POST['webmaster_id'];
  $link = $_POST['link'];
  $type = $_POST['type'];
  $hash = password_hash($dt_add . $webmaster_id, PASSWORD_DEFAULT);
  $sql = &quot;INSERT INTO table (id, dt_add, webmaster_id, name, domain, category, promo_type, hash, link)
  VALUES (null,'$dt_add','$webmaster_id','$name','$domain','$cat', '$type', '$hash', '$link')&quot;;
  
  if ($conn-&gt;query($sql) === TRUE) {
    echo &quot;New record created successfully&quot;;
  } else {
    echo &quot;Error: &quot; . $sql . &quot;&lt;br&gt;&quot; . $conn-&gt;error;
  }
  
  $conn-&gt;close();
  </code></pre>
  <p>When input has latin characters - it works fine. But if I type cyrillic - value inserts like this <code>Ð¸Ð¼Ñ ÑÐ°Ð¹Ñ‚Ð°</code>. columns <code>name</code> and <code>domain</code> has this problem. They have <code>varchar(128) utf8_general_ci</code> settings.</p>