Hello. I am using adodb for handling data of mysql. I am having data in various languages like french,english,chinese etc.. Now I want to save these data in database. I have tried to store it with adodb but other language's characters becomes question marks. In database I have made that column as 'utf-8 general ci'. If I use simple mysql connection then I can set
mysql_query("set names 'utf8'",$con) for entering data properly. What I want is that is there which changes that I have to make in order to enter different language data properly? Please help me. Thanks.

    well... if you do not have the lang packs installed on your machine and dont have the browser setup to output them you wont know if they are storing correctly

    make sure you have intl. lang support installed and then revisit your DB and/or output and see what you get

    if you set the field type type to utf-8 you should be fine

    also make sure your pages that are taking the text are utf-8 encoded:

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

      ya but what I want is that language data should be inserted properly using ADODB connection. This data is stored perfectly when I use
      mysql_query("set names 'utf8'",$con) with traditional mysql connection with php. But when using ADODB I don't know how to change this... So data is entered in database as ???? when the data is in some language like french, chinese etc. So that I can enter proper data in database.

        I got the solution 🙂

        Here is the code for setting collation as utf-8 in adodb connection.....

        function dbconnect()
        {
        	global $dbHostName;
        	global $dbUserName;
        	global $dbPassword;
        	global $dbName;
        	global $driver;
        
           $db = NewADOConnection($driver);
        
        $db->Connect($dbHostName, $dbUserName,$dbPassword,$dbName); 
        $db->EXECUTE("set names 'utf8'");
        
        return $db;
        }

        Now I am able to insert langugagewise data into my database...🙂

        Just two changes needed in order to insert data for particular language(like french,chinese etc..).

        1. In the table change the collation of the fields to "utf8_general_ci"

        2. During the connection of the database just add one line if you are using adodb for connection

        [B]$db->EXECUTE("set names 'utf8'");[/B]
        
        or if you are using traditional mysql then you have to write
        
        [B]mysql_query("set names 'utf8'",$con);[/B]
        
        And that's it.... :)

        Hope this will be helpful to someone facing same problem....

          Write a Reply...