Insights

How to fetch multi-lingual content from database

The basic purpose of this post is to guide you all about fetching multilingual content from database.
I mean to say that, if you have stored japanese text in your database, So in order to fetch the japanese content , you need to set the character encoding to UTF-8 format, while communication with the database for fetching the result.

In Case of MYSQLi

query(“SELECT ColumnName FROM tableName “)) {
printf(“Select returned %d rows.\n”, $result->num_rows);

/* free result set */
$result->close();
}
$mysqli->close();
?>

In case you are using multiple database

If you don’t pass in “true” to mysqli_connect() in the example below, $link1 and $link2 will have the same resource id# and both database connections will end up being set to utf-8 charsets.

Turn insight into action

Need help with mysql or a related project?

If this article sparked an idea, question, or project direction, I can help you turn it into a practical next step.

Start a conversationChat on WhatsApp

Related reading

Articles connected to this topic

linux

export mysql database – mysql dump

When you have access to the command line and you have the export large database, you will not be able to export from phpmyadmin. Hence mysql provide you handy method to export the database from the command line. Below are various options, you can use while exporting the database. ——databases – This allows you to [&hell

Apr 14, 2020

Read article

Most recent

Latest posts from the blog

View all articles →