Hey I tried a code that uses pdo with php and on the local wamp server it works perfectly and shows Hebrew and English but when I put the code on the web it shows me Hebrew as weird symbols like this ׳™׳—׳•׳“ ׳˜׳™׳™׳’׳¨׳™׳ ׳׳”׳ both the wamp sql table and the web sql table are set to utf8_general_ci
this is my code:
<?php
$db = new PDO('mysql:host=127.0.0.1;dbname=android;charset=utf8', 'root', '');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$stmt = $db->query('SELECT * FROM sample');
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
$out = '';
if (is_array($results) && count($results) > 0)
{
foreach ($results as $sqlRow)
{
$out .= $sqlRow['id']."|||".$sqlRow['name']."|||";
}
$out = substr($out, 0, -3);
}
echo $out;
?>