|
|
|
รบกวนสอบถามเรื่อง data base ข้างในฐานข้อมูลเป็นภาษาไทย แต่พอออก browser ไม่เป็นภาษาไทยครับ |
|
|
|
|
|
|
|
ดูพวก Charset ด้วยครับ
Code (PHP)
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
mysql_query("SET character_set_results=utf8");
mysql_query("SET character_set_client=utf8");
mysql_query("SET character_set_connection=utf8");
Go to : แก้ปัญหาภาษาไทย php กับ MySQL (TIS-620 กับ UTF-8)
|
|
|
|
|
Date :
2012-08-08 21:30:59 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้าเกิดในกรณีผมไม่ได้สร้างไฟล์ connect ไว้แต่ผมสร้าง config ไว้แบบนีัครับ
แล้วภายใจ code เป็นแบบนี้น่ะครับ โดยที่ไม่ได้ใช้ Charset
Code (PHP)
<?
# »ÃѺ»Ãا « 2550-06-04 (Version 1.1)
$mysql_host = "localhost"; // â´Â»¡µÔµÑÇá»Ã¹ÕéäÁè¶Ù¡à»ÅÕè¹
$mysql_db = "grade";
$mysql_user = "root";
$mysql_password = "9899";
#
$tb_stu = "student";
$fd[$tb_stu] =array("studentid","sfname","slname","scid");
$pk[$tb_stu] =1;
#
$tb_tec = "teacher";
$fd[$tb_tec] =array("teacherid","tfname","tlname","tpassword","tcid");
$pk[$tb_tec] =1;
#
$tb_sub = "subject";
$fd[$tb_sub] =array("subjectid","subjectname","credit","level");
$pk[$tb_sub] =1;
#
$tb_clr = "classroom";
$fd[$tb_clr] =array("classyear","classsem","classroom","room","teacherid");
$pk[$tb_clr] =4;
#
$tb_str = "studentroom";
$fd[$tb_str] =array("classyear","classsem","classroom","room","studentid");
$pk[$tb_str] =4;
#
$tb_ter = "teachroom";
$fd[$tb_ter] =array("classyear","classsem","subjectid","classroom","room","teacherid");
$pk[$tb_ter] =5;
#
$tb_mns = "mainsubject";
$fd[$tb_mns] =array("no","classroom","subjectid");
$pk[$tb_mns] =1;
#
$tb_reg = "regist";
$fd[$tb_reg] =array("classyear","classsem","subjectid","studentid","score","reexam","grade");
$pk[$tb_reg] =4;
#
$all_tb = array($tb_stu,$tb_tec,$tb_sub,$tb_clr,$tb_str,$tb_ter,$tb_mns,$tb_reg);
?>
แล้วพอจะมีทางแก้ไข้ไหมครับ
|
|
|
|
|
Date :
2012-08-14 11:42:52 |
By :
jumloon2005 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เป็นปัญหาที่ Dreamweaver หรือเปล่าครับ
|
|
|
|
|
Date :
2012-08-14 21:05:06 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รบกวนสอบถามอีกนิดครับ จากที่คุณ mr.win แนะนำมาแล้วผมลองมาใส่ตรงนี้ครับ
<?
# »ÃѺ»Ãا « 2550-06-04 (Version 1.1)
$mysql_host = "localhost"; // â´Â»¡µÔµÑÇá»Ã¹ÕéäÁè¶Ù¡à»ÅÕè¹
$mysql_db = "grade";
$mysql_user = "root";
$mysql_password = "9899";
mysql_query("SET character_set_results=utf8");
mysql_query("SET character_set_client=utf8");
mysql_query("SET character_set_connection=utf8");
#
$tb_stu = "student";
$fd[$tb_stu] =array("studentid","sfname","slname","scid");
$pk[$tb_stu] =1;
#
$tb_tec = "teacher";
$fd[$tb_tec] =array("teacherid","tfname","tlname","tpassword","tcid");
$pk[$tb_tec] =1;
#
$tb_sub = "subject";
$fd[$tb_sub] =array("subjectid","subjectname","credit","level");
$pk[$tb_sub] =1;
#
$tb_clr = "classroom";
$fd[$tb_clr] =array("classyear","classsem","classroom","room","teacherid");
$pk[$tb_clr] =4;
#
$tb_str = "studentroom";
$fd[$tb_str] =array("classyear","classsem","classroom","room","studentid");
$pk[$tb_str] =4;
#
$tb_ter = "teachroom";
$fd[$tb_ter] =array("classyear","classsem","subjectid","classroom","room","teacherid");
$pk[$tb_ter] =5;
#
$tb_mns = "mainsubject";
$fd[$tb_mns] =array("no","classroom","subjectid");
$pk[$tb_mns] =1;
#
$tb_reg = "regist";
$fd[$tb_reg] =array("classyear","classsem","subjectid","studentid","score","reexam","grade");
$pk[$tb_reg] =4;
#
$all_tb = array($tb_stu,$tb_tec,$tb_sub,$tb_clr,$tb_str,$tb_ter,$tb_mns,$tb_reg);
?>
ผมลองเปลี่ยน dream มาเป็น version CS5
แล้วยังเหมือนเดิมครับ ทำอย่างไรดีครับ
สิ่งที่มเปลียนคือนำเอา
mysql_query("SET character_set_results=utf8");
mysql_query("SET character_set_client=utf8");
mysql_query("SET character_set_connection=utf8");
มาต่อครับ
ซึ่งปัญหาของผมคือผมไม่ได่สร้าง ไฟล์ connect
สร้างไฟล์ config แทนตามด้านบนน่ะครับ ทำยังไหงดีครับ
|
|
|
|
|
Date :
2012-08-24 19:11:40 |
By :
jumloon2005 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|