Я пытаюсь поставить иврит в MySQL DB, и я прочитал все ответы, и это не сработало.Я могу поставить значение иврита с php моего администратора, поэтому проблема должна быть в сценарии.я пытаюсь использовать:
1.header ().
2.set name utf-8.
3.mysql_set_charset ().
<?php
$cate_name=$_POST['cate_name'];
$query="INSERT INTO project_food_cate (name) VALUES(?)";
$connector=new MySQLi("localhost","[redacted]","[redacted]","users");
/*this code need to put the a privalage to use hebrew values for the rows*/
header('Content-Type:text/html; charset=utf-8');
mysql_query("SET character_set_client=utf8");
mysql_query("SET character_set_connection=utf8");
mysql_query("SET character_set_database=utf8");
mysql_query("SET character_set_results=utf8");
mysql_query("SET character_set_server=utf8");
mysql_query("SET NAMES utf8");
mysqli_set_charset('utf-8',$connector);
$charset = mysql_client_encoding($connector);
echo "The current character set is:".$charset."\n"; //not giving a value.
/***************************************************************/
if (mysqli_connect_errno())
{
echo "error has been happend";
exit();
}
$stmt=$connector-> prepare($query);
$stmt-> bind_param("s",$cate_name);
$stmt-> execute();
echo $stmt-> affected_rows." has enter to this DB";
$stmt->free();
$stmt->close();
?>