im trying to do a post to a php and save in a mysql database
this is the ION.with command:
Ion.with(this)
.load("http_my_page/test.php")
.setBodyParameter("text", "não")
.asString(Charset.defaultCharset())//default=UTF-8
.setCallback(new FutureCallback<String>() {
@Override
public void onCompleted(Exception e, String result) {
}
});
my test.php page:
<?php
$test = $_POST["text"];
$servername = ...;
$username = "..";
$password = "...";
$dbname = "...";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO test (my_test) VALUES ('$test')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
and my MYSQL database has a column called my_test and collation is UTF8_unicode_ci
what im specting to store: "não"
what it really store: "não"
any reason? since im setting all the econdings =(