0

sorry if my question is duplicate , after googling i found a answer for my question that says:

 1-go to libraries folder
 2-finding file database_interface.lib.php
 3-comment below code:


  if (! empty($GLOBALS['collation_connection'])) {
  PMA_DBI_query("SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE);
   $mysql_charset = explode('_', $GLOBALS['collation_connection']);
   PMA_DBI_query("SET collation_connection = '" .      PMA_sqlAddslashes($GLOBALS['collation_connection']) . "';", $link,

  PMA_DBI_QUERY_STORE);
   } else {
   PMA_DBI_query("SET NAMES 'utf8' COLLATE 'utf8_general_ci';", $link,      PMA_DBI_QUERY_STORE);
 }

now my problem is i do not have (database_interface.lib.php) in libraries folder

version of my xampp is 3.2.2

Masoud
  • 223
  • 2
  • 13
  • 1
    phpmyadmin probably has correct configuration, and your website has some problematic collate/charset. I will be much safer for you to fix the problem in your database (and not change the way phpmyadmin works). – Dekel Dec 23 '16 at 22:32
  • i have added () in head tag of html page , any way how i can solve the problem. i use mysqli for connecting. – Masoud Dec 23 '16 at 22:39
  • You probably have default connection charset/collate. You should change them. – Dekel Dec 23 '16 at 22:39
  • i have used (utf8_unicode_ci) for collation of database in phpmyadmin. if i have to change some where else please explain more. – Masoud Dec 23 '16 at 22:43
  • It's the database configuration, it's the server configuration. – Dekel Dec 23 '16 at 22:43
  • you mean what i have done is database configuration, and now i have to change some thing in server configuration, please how? – Masoud Dec 23 '16 at 22:46
  • According answer to this question i do not have file mysqli.dbi.lib.php in my xampp – Masoud Dec 23 '16 at 23:16
  • That code seems unnecessarily complex; simply issue the `SET NAMES...`. – Rick James Dec 24 '16 at 04:18
  • Since you have not said which of about 5 erroneous outputs you are getting, see http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Dec 24 '16 at 04:19

1 Answers1

2

I added below code before any insert and select statements, and now it works.

$conn->set_charset('utf8');

Masoud
  • 223
  • 2
  • 13