MySQL veritabanı içine rusça metin ekleyemezsiniz

0 Cevap php

When I'm trying to insert russian text into MySQL database it inserts it like: г???????????? ?? ????????
Рісѓрїр°ріс‹рї р° с‹рір°рї

Registration.php ve adduser.php: Yani, iki sayfa var. Bunların her birinde

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Veritabanı 11 tablo oluşur, her tablo harmanlama vardır: utf8_general_ci, tipi: MyISAM. Utf8_general_ci: Her masada her alan Harmanlama vardır.

Ben phpMyAdmin doğrudan veritabanına yazma ve daha sonra web sayfasına bu verileri göstermek zaman. İngilizce ve Rusça - tüm Tamam.

Ama benim registration.php kişisel veri formu ve daha sonra adduser.php gidiyor tam olduğumda - sayfa ve veritabanı çok - ben üst yazdı görüntülenen tüm rusça karakterler.

    function AddNewUser($Name, $Surname, $FatherName, $Email, $Password, $Phone, $DegreeID, $RankID, 
$Organization, $Department, $Country, $City, $Address, $Job)
{
        //fetch data from database for dropdown lists
        //connect to db or die)
    $db = mysql_connect($GLOBALS["gl_kussdbName"], $GLOBALS["gl_kussUserName"], $GLOBALS["gl_kussPassword"] ) or die ("Unable to connect");

    //to prevenr ????? symbols in unicode - utf-8 coding
    mysql_query("SET NAMES 'UTF8'");

    //select database
    mysql_select_db($GLOBALS["gl_kussDatabase"], $db);
    $sql = "INSERT INTO UserDetails (
UserFirstName,
UserLastName,
UserFatherName,
UserEmail,
UserPassword,
UserPhone,
UserAcadDegreeID,
UserAcadRankID,
UserOrganization,
UserDepartment,
UserCountry,
UserCity,
UserAddress,
UserPosition) 
VALUES(
'".$Name."',
'".$Surname."',
'".$FatherName."',
'".$Email."',
'".$Password."',
'".$Phone."',
'".$DegreeID."',
'".$RankID."',
'".$Organization."',
'".$Department."',
'".$Country."',
'".$City."',
'".$Address."',
'".$Job."'
);";
    //execute SQL-query
    $result = mysql_query($sql, $db);
    if (!$result) 
    {
        die('Invalid query: ' . mysql_error());
    }
    //close database  = very inportant
    mysql_close($db);

}
?>

PhpMyAdmin içinde orada da bu bilgiler:

auto increment increment    1
auto increment offset   1
autocommit  ON
automatic sp privileges ON
back log    50
basedir \usr\local\mysql-5.1\
big tables  OFF
binlog cache size   32,768
binlog format   STATEMENT
bulk insert buffer size 8,388,608
character set client    utf8
(Global value)  cp1251
character set connection    utf8
(Global value)  cp1251
character set database  cp1251
character set filesystem    binary
character set results   utf8
(Global value)  cp1251
character set server    cp1251
character set system    utf8
character sets dir  \usr\local\mysql-5.1\share\charsets\
collation connection    utf8_general_ci
(Global value)  cp1251_general_ci
collation database  cp1251_general_ci
collation server    cp1251_general_ci
completion type 0
concurrent insert   1

So I need to properly show, save and select russian text from database. Thanx! connect timeout 10 datadir \usr\local\mysql-5.1\data\

0 Cevap