|
|
|
แก้ยังไงก้ไม่ผ่านซักที่ค่ะปัญหาภาษาในฐานข้อมูลเป็น ???????? |
|
|
|
|
|
|
|
เป็นในฐานข้อมูลแก้ยากนะ
|
|
|
|
|
Date :
2010-02-06 16:49:02 |
By :
onedan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ช่วยที นะค่ะ อันนี้ code หน้า ส่งข้อมูลไปในฐานข้อมูลค่ะ
Code (PHP)
<?php
$admin_name=$_POST['admin_name'];
$admin_idcard=$_POST['admin_idcard'];
$admin_address=$_POST['admin_address'];
$admin_telephone=$_POST['admin_telephone'];
$admin_email=$_POST['admin_email'];
$admin_position=$_POST['admin_position'];
$admin_username=$_POST['admin_username'];
$admin_password=$_POST['admin_password'];
$photo=$_FILES['photo']['tmp_name'];
$photo_name=$_FILES['photo']['name'];
$photo_size=$_FILES['photo']['size'];
$photo_type=$_FILES['photo']['type'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<title>Information systems</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<link href="css2.css" rel="stylesheet" type="text/css" />
<link href="setfont.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="524" height="235" align="right" id="FlashID2">
<param name="movie" value="images/pr.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object data="images/pr.swf" type="application/x-shockwave-flash" width="524" height="235" align="right">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object></td>
</tr>
</table>
<div>
<table width="515" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="515">
<table width="516" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="255" height="51"><div align="left" class="fontBig"> Registration Officer. </div></td>
<td width="267"><img src="images/iconmenu/Add.png" width="71" height="71" /></td>
</tr>
<tr>
<td height="51" colspan="2"><div>
<div align="center"><?php
include "connect.php";
mysql_query("SET NAMES UTF8");
$sql1="SELECT * FROM admin WHERE admin_username = '$admin_username' ";
$result1 = mysql_db_query($dbname,$sql1);
$num1=mysql_num_rows($result1);
if($num1>0) {
echo "<h3><center>ERROR :Username Invalid</center></h3>";
echo "<h3><center><a href='regis_admin.html'>Return to Register</a></h3>";
exit();
}
if (!$photo) {
echo "<h3>ERROR : Can not Upload Photo</h3>";
echo "<h3><center><a href='regis_admin.html'>Return to Register</a></h3>";
} else {
include "connect.php";
$sql = "INSERT INTO admin VALUES (NULL,'$admin_name','$admin_idcard','$admin_address','$admin_telephone','$admin_email','$admin_position','$admin_username','$admin_password','$photo')";
$result = mysql_db_query($dbname,$sql);
$ee = explode('.', $photo_name);
$e = end($ee);
if ($e=="jpg" or $e=="jpeg" or $e=="gif" or $e=="png" or $e=="JPG" or $e=="JPEG" or $e=="GIF" or $e=="PNG") {
$sql="select max(id) from admin";
$result=mysql_db_query($dbname,$sql);
$r=mysql_fetch_array($result);
$id_max=$r[0];
$filename=$id_max.".".$e;
copy($photo,"photo/$filename");
$sql="update admin set photo='$filename' where id='$id_max' ";
mysql_db_query($dbname,$sql);
echo "Save successfully. </br>Please close this window and login to system";
}else{
echo "<h3>ERROR :Unable to save data at this time.</h3>";
}
unlink($photo);
mysql_close();
}
?>
</div>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID2");
//-->
</script>
</body>
</html>
|
|
|
|
|
Date :
2010-02-06 17:03:28 |
By :
leehoon5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
จะร้องไห้แล้วนะค่ะ
|
|
|
|
|
Date :
2010-02-06 17:21:08 |
By :
leehoon5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แล้ว DB ใช้เป็นไรอะ UTF-8 ปะ
|
|
|
|
|
Date :
2010-02-06 19:13:05 |
By :
naskw |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ช่ายค่ะ
|
|
|
|
|
Date :
2010-02-06 23:24:50 |
By :
leehoon5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ฐานข้อมุลใช้เป้น utf8 แล้วไฟลืconnect ที่จะติดต่อกับฐานข้อมุลนะค่ะ ไปกำหนดcharset มันด้วยค่ะ ว่าให้เป็นutf8 ลองดูนะค่ะ เค้าก็เคยเป้น เราก้แก้แบบนี้แหละ สุ้ๆๆจร่า
|
|
|
|
|
Date :
2010-02-06 23:31:29 |
By :
anchalika |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
กรณีที่ 1 ต้องการที่จะนำข้อมูลมาแสดงเป็นไทย
<?php
$host = "" ;
$username = "" ;
$password = "" ;
$db = "" ;
$connect = mysql_connect($host,$username,$password) ;
mysql_select_db($db) ;
mysql_db_query($db,"SET NAMES tis620"); //เซทค่าให้แสดงภาษาไทย
?>
กรณีที่ 2 ต้องการจะให้ข้อมูลในฐานข้อมูลเป็นภาษาไทย
ให้คุณตั้งค่าตอนสร้างฐานข้อมูลให้เป็น UTF-8 ทั้งหมด
|
|
|
|
|
Date :
2010-02-07 03:17:14 |
By :
Manussawin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|