|
 |
|
upload file เป็นภาษาไทยลงฐานข้อมูลได้ แต่เวลาโหลดไฟล์ มันโหลดไม่ได้อ่ะครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("car");
mysql_query("SET NAMES UTF8");
$sql = "SELECT MAX(rent_id) AS rent_id FROM car_rent ";
$result = mysql_query($sql) or die ("Query Error : MAX(rent_id) " . mysql_error());
$record = mysql_fetch_array($result);
$rid = $record["rent_id"];
if(move_uploaded_file($_FILES["filUpload"]["tmp_name"],"pdf/".$_FILES["filUpload"]["name"]))
{
echo "Copy/Upload Complete<br>";
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("car");
mysql_query("SET NAMES UTF8");
$strSQL = "INSERT INTO upload_pdf ";
$strSQL .="(up_pdf,rent_id) VALUES ('pdf/".$_FILES["filUpload"]["name"]."', '$rid')";
$objQuery = mysql_query($strSQL);
}
echo "<meta http-equiv='refresh' content='0;URL=rent_show_text.php'>";
//*** Update Record ***//
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("car");
$strSQL = "UPDATE car_rent SET status_up ='1' WHERE rent_id = '$rid' ";
$objQuery = mysql_query($strSQL);
?>
</html>
อันนี้เป็นฐานข้อมูลครับ
พอผมอัพโหลดไฟลืเรียบร้อยแล้วมันลงฐานข้อมูลเป็นภาษาไทยเรียบร้อยปกติดี แต่พอเปิดโหลดไฟล์ มันโหลดไม่ได้ครับ มันขึ้นอย่างนี้ครับ

Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2012-03-16 19:36:31 |
By :
มือใหม่ |
View :
1549 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปลี่ยนเป็นภาษาอังกฤษดีที่สุดครับ จะได้ไม่มีปัญหากับหลาย ๆ Browser ครับ แต่ถ้าจะยังยืนยันลองดูพวก
- iconv()
- urlencode
ครับ
|
 |
 |
 |
 |
Date :
2012-03-16 20:11:54 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ ขอบคุณมากเลยครับ แต่ขอถามต่ออีกนิดนึง ตัวฐานข้อมูล จะเป็น UTF-8 general-ci กับ UTF-8 unicode-ci จะมีข้อแตกต่างกันรึเปล่าครับ
|
 |
 |
 |
 |
Date :
2012-03-16 20:49:38 |
By :
มือใหม่ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|