ช่วยที ฐานข้อมูลก็เป็น utf8_general_ci แต่ทำไมเว็บอ่านไทยไม่ออก

เริ่มโดย webdevils, 09 มกราคม 2009, 20:02:14

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

webdevils

ช่วยที ฐานข้อมูลก็เป็น utf8_general_ci แต่ทำไมเว็บอ่านไทยไม่ออก อะครับ ลองหาวิธีทำในgoogle แล้วก็ งงมากมาย แก้ยังไงดีครับ :P
[direct=https://my.hawkhost.com/aff.php?aff=15523]hawkhost 10GB ปีละ 800 บาท[/direct]

บอท!

ขอรายละเอียดเพิ่ม
ขอไว้ให้คนรู้มาตอบ ผมไปพักก่อนนะครับ :D
/*SEO ทำอย่างไร สอนผมบ้างนะครับ*/
Original King is King of all King.
King who come to be Legend.
//all roads lead to rome
[direct=http://www.thaiseoboard.com/index.php/topic,12238.0.html/]สารบัญ (Search Engine Optimization) [/direct]
[direct=http://www.thaiseoboard.com/index.php/topic,130993.20.htm]--= 10 ความเข้าใจผิดเกี่ยวกับ seo ----dr.k-------[/direct]
[direct=http://www.thaiseoboard.com/index.php/topic,11787.0.html]ไม่มีอะไรจ๊ะ[/direct]

slotpro

พิมพ์แล้วเป็น ???? เหรอครับแน่ใจนะว่าตารางฐานข้อมูลเป็น  utf8_general_ci
[direct=http://www.noartclub.com]Joomla[/direct] | [direct=http://www.slotidea.com]รับทำเว็บ[/direct] | [direct=http://bit.ly/aiFWI1] Moderator Team jSeblod[/direct]
[direct=http://www.slotidea.com][/direct]

webdevils

���  เป็นตัวแบบนี้  ในฐานข้อมูลมันบอกว่าเป็นutf8_general_ci อะครับ 
[direct=https://my.hawkhost.com/aff.php?aff=15523]hawkhost 10GB ปีละ 800 บาท[/direct]

cracker

ลองใส่ code นี้หลังคำสั่ง mysql_connect  ดูครับ น่าจะได้มั้ง

$setqry = 'SET CHARACTER SET utf8';
mysql_query($setqry);
$setdata ="SET collation_connection = 'utf8_general_ci' ";
mysql_query($setdata);

ball6847

หลัง mysql_connect(); แล้ว mysql_select_db(); เรียบร้อยแล้ว
เพิ่มอันนี้เข้าไป

mysql_query('SET NAMES utf8');

แล้วที่ <head> ของ html อย่าลืม
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

ถ้าเป็นสคริปท์สำเร็จรูปก็ แกะเอาก่อน เหอๆ
We use Ubuntu.

[direct=http://ng-seo.sourcelab.xyz/]AngularJS SEO Experimental[/direct]

beg

ตรวจสอบ 3 จุดนี้ แก้ปัญหาได้แน่นอน  :) :)
1.ไฟล์เว็บ php html ต่างๆ เซฟเป็น UTF-8 เท่านั้น (ปกติจะเป็น ANSI  )
2.Header เป็น <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
3.ฐานข้อมูลเป็น utf8_general_ci

Dr.K

อ้างถึงจาก: beg ใน 09 มกราคม 2009, 21:44:00
ตรวจสอบ 3 จุดนี้ แก้ปัญหาได้แน่นอน  :) :)
1.ไฟล์เว็บ php html ต่างๆ เซฟเป็น UTF-8 เท่านั้น (ปกติจะเป็น ANSI  )
2.Header เป็น <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
3.ฐานข้อมูลเป็น utf8_general_ci
4.
[direct=https://www.thaihealth.net/blog/seo_doctor/]seo blog[/direct]|[direct=https://netplushost.com]netplushost[/direct]
[direct=https://pattayawebmarketing.com/pattaya-seo]pattaya seo[/direct]
[direct=https://dochost.net]seo hosting[/direct]

Tee++;

1. Web Page ต้อง Save เป็น Encoding = UTF-8
2. Header หรือ meta ต้องเป็น UTF-8
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
OR
header('Content-Type: text/html; charset=utf-8');

3. DB ต้องเป็น utf8_general_i (case insensitive)
4. การ Fetch Data หรือ put Data ต้องบอก MySQL ว่า เป็น utf-8

**** ทำหลังจาก select table
mysql_query('SET character_set_results=utf8');
mysql_query('SET collation_connection=utf8_general_ci');
mysql_query('SET NAMES utf8');

5. Server Config ต้อง Support ส่วนมาก 99% มีแต่พวก โฮสต์ญี่ปุ่นบางที่ ไม่ support
[direct=http://laravel.in.th]Laravel in Thai[/direct]
[direct=http://jquerytips.com]jQueryTips by Tee++;[/direct]
[direct=https://www.facebook.com/jQueryTips]jQueryTips Page[/direct]
[direct=https://www.facebook.com/Laravel.in.th]Laravel in Thai Page[/direct]
[direct=https://twitter.com/Teepluss]Teepluss's Twitter[/direct]


jedixxx

mysql_query("SET NAMES UTF8");

เพิ่มนี้เข้าไปอีกบรรทัด หลัง บรรทัด mysql_connect

เพื่อบอกมันว่าจะ ติดต่อแบบ UTF-8

แต่ผมละอยากรู้จริงๆ MySQL นี้มีตั้งค่าการเชื่อมต่อ มาตราฐาน คือ รหัสภาษาอักษรตัวไหน
-จำหน่าย zip code ของ สหรัฐ ซึ่งจัดเก็บไว้ในรูปแบบไฟล์ CSV, mdb, xls สนใจติดต่อได้ครับ

-รับทำเว็บไซต์ด้วย PHP, MySQL สนใจติดต่อได้ครับ

gotuktuk

Happy เฮงๆ รวยๆ 2013

kao_jeng

ขอบคุณมากครับ ช่วยชีวิต ผมไว้  ง่า  เข้าไปดูได้ที่้ http://greenday.bectero.com

คือ คนเก่าเขาทำไว้ แย่สุด ใน phpMyAdmin เป็น ???? หมด คือ set table เป็น tis-620 ดึงไปใช้เป้น utf-8 ไม่รู้จะแปลงกลับไปกลับมาทำไม  ขอบคุณ กระทู้นี้มากๆครับ ผมงมมาทั้งคืน  :wanwan020: :wanwan020:

pomchai