(ASK)Used UTF8 in PHP in MSSQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gandaBudi
Forum Newbie
Posts: 1
Joined: Tue Jan 26, 2010 1:40 am

(ASK)Used UTF8 in PHP in MSSQL

Post by gandaBudi »

All Help Me please ... iam newbie in PHP programming end stuck in here code
for Example in MySQL :

Code: Select all

$cs1 = “SET character_set_results= utf8“;
mysql_query($cs1) or die(‘Error query: ‘ . mysql_error());
$cs2 = “SET character_set_client = utf8“;
mysql_query($cs2) or die(‘Error query: ‘ . mysql_error());
$cs3 = “SET character_set_connection = utf8“;
mysql_query($cs3) or die(‘Error query: ‘ . mysql_error());
My Question how to query use UTF8 in MSSQL from php :( .
iam :banghead:

This is my Code utf8 use for Tieng Viet Problems when want to use in MSSQL

Code: Select all

<html lang="th" xmlns="http://www.w3.org/1999/xhtml" xml:lang="th">
  <meta content="text/html; charset=utf8" http-equiv="Content-Type"/>
  <meta http-equiv="Content-language" content="th"/>
    <head> </head>
    <body>
    <br />
    <?php
 
 
    require_once('ServerLog.class.php');    
    require_once ('Connection.class.php');
    
    $conn = Connection :: getConnection();
   
    mssql_select_db('NVW2',$conn);
 
    $query = "select top 10 Description from dbmCoaAttr";   
   
//      $cs1 = “SET character_set_results= utf8“;
//  mysql_query($cs1) or die(‘Error query: ‘ . mysql_error());
//
//  $cs2 = “SET character_set_client = utf8“;
//  mysql_query($cs2) or die(‘Error query: ‘ . mysql_error());
//
//  $cs3 = “SET character_set_connection = utf8“;
//  mysql_query($cs3) or die(‘Error query: ‘ . mysql_error());  
//  $result = mssql_query($query,$conn);    
        
    
    $itemList = array();  
 
        for($i=0;$i<mssql_num_rows($result);$i++){      
    $itemList[$i+1] = mssql_fetch_assoc($result);           
            
        print_r($itemList[$i+1]);   
       
    }
?>
     
    </body>   
    </html>

THIS result in browser just "????"
Post Reply