Skip to content

PHP code snippet – How to insert hindi text in mysql database?

<?php
/*
  first of all open database structure and change  
  table Collation  to (utf8_general_cithen) save the changes

  You need to just add few queries when you establish database connection so 
  that your database support for utf8 Unicode characters.
  
  Add the below lines to your database Config FIle
*/

mysqli_query($con,"SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'");
mysqli_set_charset($con,'utf8');
?>
See also  Python code snippet - How to make loop ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.