0

I have a problem with Arabic language in online server

I use PDO, and this's my connection code

$db = new PDO("mysql:host=".Config::DB_HOST.";dbname=".Config::DB_NAME.";charset=UTF8",Config::DB_USER,Config::DB_PASSWORD);

$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);

$db->query("SET NAMES utf8");
$db->query("SET CHARACTER SET utf8");

return $db;

it's work correctly in local server but when I make it on Online server the data in database is always (??????) ( collation of database is utf8_general_ci )

is there any solution ?

ThaTest
  • 105
  • 5
  • Try latin1_swedish_ci, what's the type of storage engine ? – AraByte Jun 30 '18 at 14:38
  • One thing to note is that `utf8` is not the correct charset to use. Instead use `utf8mb4`, as this supports far more - including emojis, which apparently everyone uses now (I guess emoticons just aren't good enough anymore ¯\\_(ツ)_/¯ ) – Niet the Dark Absol Jun 30 '18 at 14:43

0 Answers0