[請益] 輸入的中文_輸出均為問號
製作類似行事曆的網頁
在前端網頁上 輸入中文,重新按鈕顯示剛剛輸入的內容,凡中文的部分,
都以"?"顯示每個中文字
到後台的資料庫中 新增中文的資料 才可在網頁端 看到正常的中文輸出
(localhost測試正常)
有誰知道問題在哪嗎? 感謝!
code:
<?php
class writeNote
{
var $userName = "user"; //帳號
var $password = "12345"; //密碼
var $hostName = "mysql14.000webhost.com"; //主機(Server)名稱
//取得之前的事情內容
function getNote($noteDate){
//建立資料連結
$mylink = mysql_connect($this-> hostName, $this-> userName, $this-> password);
//選取資料庫
mysql_select_db("a4306868_data", $mylink);
//指定提取資料的校對字元表
mysql_query("set character set big5");
$sql="select * from notedata where dateNum='" . $noteDate . "'";
$dataList=mysql_query($sql);
if ($arr_result=mysql_fetch_array($dataList,MYSQL_BOTH))
{
return $arr_result["note"];
}else{
return "";
}
}
//寫入事情的內容
function setNote($noteDate,$noteMemo){
//建立資料連結
$mylink = mysql_connect($this-> hostName, $this-> userName, $this-> password);
//選取資料庫
mysql_select_db("a4306868_data", $mylink);
//指定提取資料的校對字元表
mysql_query("set character set big5");
$sql="select * from notedata where dateNum='" . $noteDate . "'";
$dataList=mysql_query($sql);
if ($arr_result=mysql_fetch_array($dataList,MYSQL_BOTH))
{
$sql="update notedata set note='" . $noteMemo. "' where dateNum='" . $noteDate . "'";
mysql_query($sql);
}else{
$sql="insert into notedata (note,dateNum) value('" . $noteMemo . "','" . $noteDate . "')";
mysql_query($sql);
}
}
}
?>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.116.39.125
推
03/06 21:35, , 1F
03/06 21:35, 1F
→
03/06 21:40, , 2F
03/06 21:40, 2F
→
03/06 21:42, , 3F
03/06 21:42, 3F
推
03/06 22:45, , 4F
03/06 22:45, 4F
→
03/06 22:46, , 5F
03/06 22:46, 5F
→
03/07 00:19, , 6F
03/07 00:19, 6F
推
03/07 12:06, , 7F
03/07 12:06, 7F
→
03/07 12:06, , 8F
03/07 12:06, 8F
→
03/07 12:53, , 9F
03/07 12:53, 9F
→
03/09 07:06, , 10F
03/09 07:06, 10F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章