2

In the back-end of my database (phpmyadmin), and in my_table>Operations directory, the setting for my Collation is already utf8_general_ci. If it's already in utf8_general_ci, do I have to change the Collation of each field/column of that table?

Sample code:

<form action="insert.php" method="POST">
    <input type="text" name="field1">
    <input type="submit">
</form>

insert.php

$stmt = $con->prepare("INSERT INTO table (column1) VALUES (?)");
$stmt->bind_param('s',$_POST["field1"]);

Note:

Special characters like ñ is now inserting properly after the first method above, but when a user inputs (not '), the character will be changed to ’.

Question:

How can I insert properly special characters without disrupting the other characters?

Logan Wayne
  • 6,001
  • 16
  • 31
  • 49
  • Sounds like your *input* is not actually UTF-8 encoded. Did you follow the duplicate in detail? Also see [Handling Unicode Front To Back In A Web App](http://kunststube.net/frontback/) – deceze Feb 09 '15 at 01:37

0 Answers0