|
 |
|
ผมเอาข้อมูลลงฐานข้อมูลแล้วไม่เป็นภาษาไทยอะครับแก้ไขยังไงดี |
|
 |
|
|
 |
 |
|
ลองดูโค๊ดนะครับ
Code (PHP)
<?php
$hostname="localhost";
$username="root";
$password="password";
$dbname="it_gsb_cm";
$tblname="person";
mysql_connect($hostname,$username,$password) or die("Unable to connect database");
mysql_query("SET NAMES UTF8");
mysql_select_db($dbname) or die("Unable to connect database");
$id_gsb=$_POST["id_gsb"];
$p_picture=$_POST["p_picture"];
$id_sex=$_POST["id_sex"];
$id_prefix=$_POST["id_prefix"];
$p_name=$_POST["p_name"];
$address_number=$_POST["address_number"];
$address_moo=$_POST["address_moo"];
$address_village=$_POST["address_village"];
$address_lane=$_POST["address_lane"];
$address_tumbon=$_POST["address_tumbon"];
$address_amphur=$_POST["address_amphur"];
$address_province=$_POST["address_province"];
$address_postcode=$_POST["address_postcode"];
$p_phone=$_POST["p_phone"];
$p_email=$_POST["p_email"];
$birthday_date=$_POST["birthday_date"];
$id_nation=$_POST["id_nation"];
$id_nationnality=$_POST["id_nationnality"];
$id_religion=$_POST["id_religion"];
$id_position=$_POST["id_position"];
$id_groupwork=$_POST["id_groupwork"];
$job_start_date=$_POST["job_start_date"];
$p_salary=$_POST["p_salary"];
$id_kind_emp=$_POST["id_kind_emp"];
$id_permission=$_POST["id_permission"];
$username=$_POST["username"];
$password=$_POST["password"];
$sql="insert into $tblname(ID_GSB,ID_Sex,ID_Prefix,P_Name,P_Picture,Address_Number,Address_Village, Address_Lane,Address_Moo,Address_Tumbon,Address_Amphur,Address_Province,Address_Postcode, P_Email,P_Phone,Birthday_Date,ID_Nationality,ID_Nation,ID_Religion,ID_Position, ID_GroupWork,Job_Start_Date,P_Salary,ID_Kind_Emp,Username,Password,ID_Permission) values('$id_gsb','$id_sex','$id_prefix','$p_name','$p_picture','$address_number','$address_village', '$address_lane','$address_moo','$address_tumbon','$address_amphur','$address_province', '$address_postcode','$p_email','$p_phone','$birthday_date','$id_nationnality','$id_nation', '$id_religion','$id_position','$id_groupwork','$job_start_date','$p_salary','$id_kind_emp','$username','$password','$id_permission')";
$result=mysql_db_query($dbname,$sql);
mysql_close();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
</body>
</html>
มันเข้าฐานข้อมูลนะครับแต่ไม่เป็นภาษาไทยอะในฐานข้อมูล ช่วยตอบทีนะครับ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-11-30 21:03:46 |
By :
BoyComCMU |
View :
819 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ต้องดูว่า Database ของเรา กำหนดเป็น UTF ด้วยหรือเปล่าครับ
ถ้ากำหนด
ให้ลอง เอาบรรทัด mysql_query("SET NAMES UTF8"); มาไว้ที่ บรรทัดที่ 10 แทนนะครับ
|
 |
 |
 |
 |
Date :
2009-11-30 21:10:16 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากครับ
ผมจะไปลองทำดูครับ
|
 |
 |
 |
 |
Date :
2009-11-30 22:20:58 |
By :
BoyComCMU |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|