OK, I need help!!!!!!! I've tried every advice I could find on google, nothing works for me!!!!!
my DB has data in hebrew
I can't figure out how to set the collation and everything else right so that my site would show the data in hebrew when I echo it from the DB. I tried every collation possible urg!!
utf8_general_ci
hebrew_bin
hebrew_general_ci
utf8_bin
I tried to change the Meta in html to charset=utf-8 and charset=windows-1255
and nothing works!!! the best case was when the DB was hebrew_general_ci and charset was windows 1255..that way I saw hebrew text on my page (static text) and what's echoed from the DB was '????'
any other combination of settings just made it worst, I either don't see even static text, or it's something like 235g4hj5ghj34g6 in the DB
my PhpMyAdmin is 3.3.9. it says- Server version: 5.5.8, MySQL charset: UTF-8 Unicode (utf8)
I use the localhost XAMPP(the site is not on a host server)
please help me I gotta make it work!!!!
can someone send me a simple php file with all the right setting in the head/meta/header()and guide me on how to set the db right????
I'm using this simple code to test..
I want to see on the page something like this:
עברית
123 שדג
234 דדגקקרכנ
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="rtl">
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<head>
<title>Index</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body rightmargin="0" topmargin="0" bgcolor="#96928F">
<div> עברית </div>
<?php
$dbc = mysqli_connect('localhost', 'root', '', 'hebDB')
or die('Error connecting to MySQL server.');
mysql_set_charset('utf8',$dbc);
$query = "SELECT * FROM tblheb";
$result = mysqli_query($dbc, $query)
or die('Error querying database.');
while ($row = mysqli_fetch_array($result)){
echo $row['id'].' '.$row['name'].'<br/>';
}
?>
</body>
</html>