<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>d.CAT- the RIA blog &#187; 
php/mysql</title>
	<atom:link href="http://ria.richtechmedia.com/category/phpmysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://ria.richtechmedia.com</link>
	<description>a dedicated Flash&#124;Flex Rich Internet Application Blog from a senior Flex RIA developer/instructor</description>
	<lastBuildDate>Wed, 07 Apr 2010 02:39:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>php v5.1.* 時區設定抓取 GMT+800</title>
		<link>http://ria.richtechmedia.com/2006/04/07/php-v51-%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a%e6%8a%93%e5%8f%96-gmt800/</link>
		<comments>http://ria.richtechmedia.com/2006/04/07/php-v51-%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a%e6%8a%93%e5%8f%96-gmt800/#comments</comments>
		<pubDate>Fri, 07 Apr 2006 01:38:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[
php/mysql]]></category>

		<guid isPermaLink="false">http://ria.richtechmedia.com/2006/04/07/php-v51-%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a%e6%8a%93%e5%8f%96-gmt800/</guid>
		<description><![CDATA[今早六點半就起床準備十一點的demo，結果意外的發現在開發機上運作正常的程式 deploy 到 notebook後居然連login都進不去。
經過一番測試才發現nb上裝的環境是 php 5.1.1 + mysql 5.1 而開發機是 php 5.0.4 + mysql 4.1，從 php 5.1開始php是預設抓美國時區，所以timezone必需要在php.ini裏正確設定。
語法如下：
php.ini 內 
[date]
date.timezone = Asia/Taipei
另外有一個 php function (signature 如下):
bool date_default_timezone_set ( string timezone_identifier )
只要輸入  date_default_timezone_set( &#8220;Asia/Taipei&#8221; ) 即可。
這件事得到兩件教訓：
-開發過程中沒事千萬別換系統版本，即使版號只差 0.1 也不能動，只要有一個地方改變，整個 QA process就要重跑一遍
-RTFM
]]></description>
		<wfw:commentRss>http://ria.richtechmedia.com/2006/04/07/php-v51-%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a%e6%8a%93%e5%8f%96-gmt800/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>【保証成功】的 mysql 中文亂碼解決方案</title>
		<link>http://ria.richtechmedia.com/2005/12/19/%e3%80%90%e4%bf%9d%e8%a8%bc%e6%88%90%e5%8a%9f%e3%80%91%e7%9a%84-mysql-%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88/</link>
		<comments>http://ria.richtechmedia.com/2005/12/19/%e3%80%90%e4%bf%9d%e8%a8%bc%e6%88%90%e5%8a%9f%e3%80%91%e7%9a%84-mysql-%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88/#comments</comments>
		<pubDate>Mon, 19 Dec 2005 05:23:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[
php/mysql]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=313</guid>
		<description><![CDATA[I promise this is gonna be the last time on it  
自從寫完下面兩篇文章：
wordpress 1.5升級注意事項 - 中文亂碼篇
mysql 4.1中文亂碼第二擊
過去幾個月就不斷有來信詢問各種 mysql 中文相容的問題，所以有機會看到許多玩家們用的各式連接法與程式，實在太開眼界。
最近因為轉換到 flex 2做為開發平台並重寫一些產品，許多去年寫的 framework 就無法使用，而其中有部份專門處理多國語系的library也隨之失效，導致我得重新面對這個問題，所以正好籍此機會將一些新心得整理出來。
＊mysql中文亂碼的原因
mysql 會出現中文亂碼的原因不外乎下列幾點：
-mysql server本身設定問題，例如還停留在 latin1
-mysql table 的語系設定問題(包含 character 與 collation)
-客戶端程式(例如 php) 的連線語系設定問題
在之前的兩篇文章中已介紹過如何設定 mysql server/table 的 character/collation。
接下來只需要補充幾點注意事：
＊mysql中文亂碼必勝解決法
1、mysql 啟動時會讀取一個預設的 config 檔，一般名稱為 my.ini，而它會到下列兩位置去尋找這個檔案：
C:\windows\my.ini   也就是作業系統的安裝目錄，也有可能是 C:\winnt\my.ini
C:\:my.cnf           [...]]]></description>
		<wfw:commentRss>http://ria.richtechmedia.com/2005/12/19/%e3%80%90%e4%bf%9d%e8%a8%bc%e6%88%90%e5%8a%9f%e3%80%91%e7%9a%84-mysql-%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
		<item>
		<title>mysql 4.1中文亂碼第二擊</title>
		<link>http://ria.richtechmedia.com/2005/08/14/mysql-41%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e7%ac%ac%e4%ba%8c%e6%93%8a/</link>
		<comments>http://ria.richtechmedia.com/2005/08/14/mysql-41%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e7%ac%ac%e4%ba%8c%e6%93%8a/#comments</comments>
		<pubDate>Sun, 14 Aug 2005 03:34:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[
php/mysql]]></category>

		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=213</guid>
		<description><![CDATA[自從貼了wordpress 升級與mysql中文亂碼這篇後，大概每天都有有幾十個依此關鍵字而來的網友，同時也接到一些email詢問大同小異的亂碼問題，仔細想想後覺得還是把這個問題再解釋清楚一點。
首先，要讓mysql 4.1正確顯示中文最簡單的方法就是全程使用 utf8，從網頁到連線到資料庫等，而my.ini的設定如下：
[mysqld]
default-character-set=utf8
#settings for clients (connection, results, clients)
[mysql]
default-character-set=utf8
其中 [mysqld] 是設定 mysql啟動時要採用的語系，而[mysql]則是通知外來的連線client(例如php頁面或 flash 程式)要使用何種語系設定。
這個設定方法對一般的開發工作非常適用，但有個小缺點，就是當使用一些open source php程式時(尤其是英文寫的程式)，如果這些程式語法還停留在mysql 4.0時代，那上面的設定就會導致中文顯示變的怪怪的，最明顯的情況就是大部份中文都顯示的出來，但少部份會變成 方塊型+問號 的亂碼，例如「裏」這個字幾乎是穩死。
這種情況我個人在 drupal 與 gregarius(一個php rss reader) 上見過，經過一番debug才發現了上述原因，後來終於找到解決方法。
最簡單的方式就是不要下面這段：
[mysqld]
default-character-set=utf8
拿掉這段後會讓mysql 啟動時停留在預設的latin-1語系，這樣會讓大部份英文程式都很快樂，而要使用utf8中文的人，只要記得建資料庫時將它設成utf8，然後保留 [mysql] 這段設定，讓中文程式正確的使用utf8與它溝通即可。
經過測試，這樣改良後的設定，使用常見的英文php軟體(如wordpress, drupal, OSCommerce, gregarius)都沒問題，而我每天開發要用的  flash - amfphp - php - mysql 黃金組合也同樣ok。
]]></description>
		<wfw:commentRss>http://ria.richtechmedia.com/2005/08/14/mysql-41%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e7%ac%ac%e4%ba%8c%e6%93%8a/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>wordpress 1.5升級注意事項 &#8211; 中文亂碼篇</title>
		<link>http://ria.richtechmedia.com/2005/07/27/wordpress-15%e5%8d%87%e7%b4%9a%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e7%af%87/</link>
		<comments>http://ria.richtechmedia.com/2005/07/27/wordpress-15%e5%8d%87%e7%b4%9a%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e7%af%87/#comments</comments>
		<pubDate>Wed, 27 Jul 2005 07:28:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[
php/mysql]]></category>
		<category><![CDATA[blog related]]></category>

		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=192</guid>
		<description><![CDATA[＊中文亂碼
大部份人升級wordpress 1.5時碰到的問題都是中文亂碼，尤其是如果原本用 mysql 4.0 而同時要升級到 mysql 4.1的話。
主要原因是mysql 4.1在語系方面增加了許多功能，它可以設定語系的層次從最底層的 server, database 到單一 table, column, connection 都可以設定，而除了語系之外，還可以指定搭配不同的 collation，所以組合百百種，只要一個錯了就難逃亂碼的命運。(而之前用mysql 4.0為何不用設定也不會出問題呢？主要原因是那時預設是 latin-1，正好相容大部份的utf-8字元，所以不常碰到亂碼)
所以如果你的情況跟我一樣，同時要將 wordpress 從 v1.2升級到 v1.5, 然後mysql也要 v4.0 升級到 v4.1 的話，請看下面流程：
0. 先進phpmyadmin找到可輸入 sql query的畫面，然後鍵入：
show variables like '%character%';
這句話會顯示目前資料庫使用的語系設定，一般國外的網站或剛裝好的 mysql 4.1預設都是 latin-1。
1 新增wordpress blog要用的database名稱，例如 myblog.
如果你熟悉 phpmyadmin 的操作，在畫面上就可以選擇這個新database 要用的語系，
charset 請選擇  UTF-8 Unicode (utf8)
collation 請選擇  utf8_general_ci  (ci 代表 case insensitve [...]]]></description>
		<wfw:commentRss>http://ria.richtechmedia.com/2005/07/27/wordpress-15%e5%8d%87%e7%b4%9a%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-%e4%b8%ad%e6%96%87%e4%ba%82%e7%a2%bc%e7%af%87/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

