mysql_queryset-names-utf8

Questionsmysql_queryset-names-utf8
Mario Berg asked 6 years ago

In previous Version this code worked, hat all words on site were set to UTF8: mysql_query(\”SET NAMES \’utf8\’\”); In new php-Version I see  \”M�nchen\” instead of \”München\”. What is the correspondence for this line in mysql for the same effect?

3 Answers
Mario Berg answered 6 years ago

In previous Version this code worked, that all words on site were set to UTF8:

mysql_query(”SET NAMES ’utf8’”);

In new php-Version I get charset errors like \”M�nchen\” instead of \”München\”. Thus, what is the correspondence for this line in mysqli to get the right charset?

Abu Ghufran Staff answered 6 years ago

If you are using it for phpgrid, it is included inside library to use UTF8 as default encoding.

If you using independently, we can refer: http://php.net/manual/en/mysqli.set-charset.php

mysqli_set_charset($link, “utf8”)

where $link is $link = mysqli_connect(…);

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Mario Berg answered 6 years ago

thanx, yes it was in external PHP-Code. I use now <?php echo utf8_encode($variablename);?>

Your Answer

19 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?