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?