|
 |
|
ขอสอบถามครับ เกี่ยวกับการบันทึก/อัพเดทข้อมูลภาษาไทยใน microsoft access แล้วอ่านไม่ได้ |
|
 |
|
|
 |
 |
|
บันทึก/อัพเดท ภาษาไทยลงใน Access แล้วได้ข้อความลักษณะแบบนนี้ครับ "เธชเธธเธฃเธฐเน€เธเธฉเธเน"
ตัวอย่างโค้ดที่ใช้ครับ
Code (PHP)
//header('Content-Type: text/html;charset=utf-8');
$dsn_name = "EmployeeDemo";
$username ="";
$password ="";
$connect = odbc_connect($dsn_name, $username, $password);
//odbc_exec($connect, "SET NAMES 'UTF8'");
//odbc_exec($connect, "SET client_encoding='UTF-8'");
$sql = "UPDATE EmpUser SET Name = 'ชื่อไทย' WHERE ID = 1 ";
$execute = odbc_exec($connect, $sql);
odbc_free_result($execute);
odbc_close($connect);
echo"เพิ่มข้อมูลเรียบร้อยแล้ว";
โดยก่อนที่จะทำการอัพเดพ ผมนำข้อมูลออกมาแสดงจะต้องใช้คำสั่ง
iconv('TIS-620', 'UTF-8', trim($objResult["sEmpFirstName"]));
ถึงจะสามารถแสดงเป็นภาษาไทยได้ แต่เมื่ออัพเดทแล้วไม่ต้องใช้คำสั่ง iconv ก็แสดงภาษาไทย แต่ข้อมูลใน Access จะได้แบบข้อความข้างบน
รบกวนด้วยครับ _/\_
Tag : PHP, Ms Access, JavaScript, Apache, XAMPP, Windows

|
|
 |
 |
 |
 |
Date :
2021-03-06 18:55:38 |
By :
Bang23 |
View :
960 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
odbc_exec($connect, "SET NAMES UTF8");
ถ้าไม่ได้ ลอง
Code (PHP)
odbc_exec($connect, "SET NAMES TIS-620");
|
ประวัติการแก้ไข 2021-03-08 14:22:31
 |
 |
 |
 |
Date :
2021-03-08 14:22:01 |
By :
mongkon.k |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ข้อมูลถูกแล้ว ครับ
ถ้าจะเปิดด้วย parser ของ microsoft (สำหรับ data ตระกูล mircrosoft)
ขาด utf-8 with bom
คำค้น php header for utf-8 with bom
ขอโทษ ผิดๆ ไม่ได้สร้างไฟล์
|
ประวัติการแก้ไข 2021-03-08 16:10:55
 |
 |
 |
 |
Date :
2021-03-08 16:08:02 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|