อัพโหลดเวปขึ้น hosting แล้ว Error : File 'c:\mysql\share\charsets\?.conf' not found (Errcode: 2)...

ในกรณีรันหน้าเวปในเครื่องแล้วใช้งานได้ แต่พออัพโหลดขึ้น host แล้ว error แบบนี้ 

'c:\mysql\share\charsets\?.conf' not found (Errcode: 2)
Character set '#18' is not a compiled character set and is not specified in the 'c:\mysql\share\charsets\Index' file


อันนี้เป็น bug ของ mysql4 สำหรับ function mysql_connect ซึ่งถูกเรียกใช้ ใน body tag ครับ
วิธีแก้ไขคือ นำ function mysql_connect() ไปไว้บนสุดของ file .php นั้นๆ ที่ได้ถูกเรียกใช้ครับ

 ยกตัวอย่าง

connect.php มี mysql_connect() function อยู่
ไฟล์ที่เรียก database ให้แก้ตามนี้ครับ

 <?php

include ‘connect.php’;

?>

<!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=windows-874" />

<title>Untitled Document</title>

</head>

 <body>

 <?php code ?>

 </body>

</html>


หรือ ในกรณีที่ใช้ session

 <?php

session_start();

include ‘connect.php’;

?>

<!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=windows-874" />

<title>Untitled Document</title>

</head>

 <body>

<?php code ?>

 </body>

</html>

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

โปรแกรม TeamViewer Remote Deasktop

ดาวน์โหลดโปรแกรม  TeamViewer โปรแกรม  TeamViewer...

สามารถที่จะนำรูปโป๊หรือข้อความลามกอนาจาร มาไว้กับไชโย โฮสติ้งได้หรือไม่

ไม่สามารถทำได้เพราะเป็นสิ่งผิดกฎหมาย หากทาง ไชโย โฮสติ้ง ตรวจสอบได้ว่า ท่านนำรูปโป๊,...

เว็บไซต์ติดไวรัส ทำยังไงดี!!

เว็บไซต์ติดไวรัส ทำยังไงดี!! หน้าเว็บไซต์ติดไวรัส, เว็บไซต์อันตราย, เว็บถูกบล๊อค...

เมื่อใช้พื้นที่จนเต็มสามารถที่จะ upgrade hosting plan ได้หรือไม่

สามารถทำได้โดยทำการแจ้งขอเปลี่ยน plan เข้ามาที่ฝ่ายขาย...

ทำไมเข้าเว็ปอื่นได้ปกติ แต่บางเว็ปเข้าไม่ได้

อาจจะเกิดจากค่า dns ของผู้ให้บริการ Internet ที่ใช้บริการอยู่ไม่ update...