Note that there are some explanatory texts on larger screens.

plurals
  1. POcan't insert russian text into mysql database
    primarykey
    data
    text
    <p>When I'm trying to insert russian text into MySQL database it inserts it like: г???????????? ?? ????????<br> Рісѓрїр°ріс‹рї р° с‹рір°рї</p> <p>So, I have two pages: registration.php and addUser.php. In each of them</p> <pre><code> &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; </code></pre> <p>Database consist of 11 tables, each table has collation: utf8_general_ci, type: MyISAM. Each field in every table has Collation: utf8_general_ci.</p> <p>When I'm writing to database directly in phpMyAdmin and then show this data to web-page. In English and Russian - all OK.</p> <p>But when I'm full my form with personal data on registration.php and then going to addUser.php - all russian characters displayed like I wrote upper - on page and in database too.</p> <pre><code> 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); } ?&gt; </code></pre> <p>There also such information in phpMyAdmin:</p> <pre><code>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 </code></pre> <p>So I need to properly show, save and select russian text from database. Thanx! connect timeout 10 datadir \usr\local\mysql-5.1\data\</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload