MySQL 例:
PHP 文例以下:
header("Content-Type: text/html; charset=utf-8");
$index = 0;
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('接続できませんでした: ' . mysql_error());
}
mysql_select_db("テスト", $con);
mysql_query("set names ’utf8’");
mysql_query("setcharacter_set_client=utf8");
mysql_query("setcharacter_set_results=utf8");
$result = mysql_query("SELECT * FROM test_list
制限 0,4");
while($row = mysql_fetch_array($result))
{
$load_crouse_array[$index] = array(
'Subject_ID' => $row['Subject_ID'],
'Subject_title' => $row[ 'Subject_title']、
'Subject_url' =>$row['Subject_url']、
'Subject_belong' =>$row['Subject_belong']、
'Creat_time' =>
);
$index++;
}
mysql_query("INSERT INTO `test`.`test_list` (`Subject_ID`, `Subject_title`, `Subject_url`, `Subject_belong`, `Creat_time`) VALUES ('100005', '测试文本', 'test_url' , 'excel_crous', '2014-08-10');");
echo json_encode($load_crouse_array);
echo "テスト中国語测试中文";
?>