ทำไงให้ php เพิ่มข้อมูลลง mysql เป็นภาษาญี่ปุ่นครับ ลองหลายวิธีแล้วยังไม่ได้
แต่การแสดงผลเป็นภาษาญี่ญุนถูกต้องครับ แต่พอ เอาตัวที่เราดึงออกมา และอัพเดทลงไปใหม่เพื่อให้ในฐานข้อมูลเป็นภาษาญี่ญุ่นกลับไม่เป็นน่ะครับ
1.<meta http-equiv="Content-Type" charset="utf-8" />
2.mysql_query("set names utf-8")
3.กำหนดใน structrure=utf8_general_ci
ทั้งสามอย่างนี้ผมลองแล้วครับ
.............
<html>
<head>
<meta http-equiv="Content-Type" charset="utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
$host="localhost";
$username="root";
$password="";
$db="tdcthai_db";
$tb="data_f";
mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); /* ทำการเลือกฐานข้อมูลก่อน */
$sql="Select * From $tb ";
$db_query=mysql_query($sql);
$num_rows=mysql_num_rows($db_query);
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$id=$result[id];
$name=$result[name]
$sqlupdate="update user set name='$name' where id='$id'"
$a++;
}
mysql_close();
?>
</body>
</html>
ก็ประมาณนี้ครับ ท่านใดเคยเจอแล้วแก้ได้ช่วยชี้แนะหน่อยครับ
เขียน php แต่แอดข้อมูล ลงมายเอสคิวแอล ไม่เป็นภาษาญี่ญุ่น
แต่การแสดงผลเป็นภาษาญี่ญุนถูกต้องครับ แต่พอ เอาตัวที่เราดึงออกมา และอัพเดทลงไปใหม่เพื่อให้ในฐานข้อมูลเป็นภาษาญี่ญุ่นกลับไม่เป็นน่ะครับ
1.<meta http-equiv="Content-Type" charset="utf-8" />
2.mysql_query("set names utf-8")
3.กำหนดใน structrure=utf8_general_ci
ทั้งสามอย่างนี้ผมลองแล้วครับ
.............
<html>
<head>
<meta http-equiv="Content-Type" charset="utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
$host="localhost";
$username="root";
$password="";
$db="tdcthai_db";
$tb="data_f";
mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); /* ทำการเลือกฐานข้อมูลก่อน */
$sql="Select * From $tb ";
$db_query=mysql_query($sql);
$num_rows=mysql_num_rows($db_query);
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$id=$result[id];
$name=$result[name]
$sqlupdate="update user set name='$name' where id='$id'"
$a++;
}
mysql_close();
?>
</body>
</html>
ก็ประมาณนี้ครับ ท่านใดเคยเจอแล้วแก้ได้ช่วยชี้แนะหน่อยครับ