当我从我的应用程序中插入所有★(星星)变成“â€......”
如何阻止这种情况发生?
*如果我通过phpmyadmin直接插入它,它会起作用,但是当使用这个php直接插入时它会起作用:
<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
$inputTime = mysql_escape_string($_POST['inputTime']);
$inputBotid = mysql_escape_string($_POST['inputBotid']);
$inputImage = mysql_escape_string($_POST['inputImage']);
$inputName = mysql_escape_string($_POST['inputSkin']);
$inputStatus = mysql_escape_string($_POST['inputStatus']);
$inputTradeid = mysql_escape_string($_POST['inputTradeid']);
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO items (trade, market_hash_name, status, img, botid, time)
VALUES ('$inputTime', '$inputName', '$inputStatus', '$inputImage', '$inputBotid','$inputTime')";
if ($conn->query($sql) === TRUE) {
echo "Success";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>