<?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>電腦茶包 Blog &#187; OSCommeric</title>
	<atom:link href="http://www.minitw.com/archives/category/server/oscommeric/feed" rel="self" type="application/rss+xml" />
	<link>http://www.minitw.com</link>
	<description>解決資訊問題分享，電腦隨手筆記</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:24:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>解決 OSCommeric 顯示正常但資料庫內的中文為亂碼的問題</title>
		<link>http://www.minitw.com/archives/407</link>
		<comments>http://www.minitw.com/archives/407#comments</comments>
		<pubDate>Tue, 02 Jun 2009 03:46:43 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[OSCommeric]]></category>
		<category><![CDATA[網站架設]]></category>
		<category><![CDATA[OSC]]></category>
		<category><![CDATA[資料庫亂碼]]></category>

		<guid isPermaLink="false">http://www.minitw.com/?p=407</guid>
		<description><![CDATA[如果你在 MYSQL 強制設定 default-character-set = utf8 default-collation = utf8_general_ci OSCommeric 還是不吃你這一套，存進去的資料仍然不會是UTF8 首先請先用 OSCommeric 備份你的資料庫，備份完後請先用文字檔確認內容沒有亂碼。(很重要，後面會用到) 接下來在下面2個檔案中修改程式 osc/includes/application_top.php osc/admin/includes/application_top.php 找到 tep_db_connect() or die('Unable to connect to database server!'); 修改成下面這個樣子(2個檔案都要修改) tep_db_connect() or die('Unable to connect to database server!'); if (substr(mysql_get_server_info(), 0, 3) &#62;= '4.1') { tep_db_query("SET NAMES 'UTF8'"); } 改完後你會發現原來正常顯示的資料都變成亂碼，不用緊張 這時候再把我們之前備份的資料庫再還原回去(再次提醒還原前一定要確認備份的檔案內容是正常的，沒有亂碼的) 還原完成後，資料庫與網頁的顯示就都正常了。]]></description>
			<content:encoded><![CDATA[<p>如果你在 MYSQL 強制設定</p>
<p>default-character-set = utf<span class="currency_converter_link" title="Convert this amount">8</span><br />
default-collation = utf<span class="currency_converter_link" title="Convert this amount">8</span>_general_ci</p>
<p>OSCommeric 還是不吃你這一套，存進去的資料仍然不會是UTF8</p>
<p><a href="http://lh4.ggpht.com/_HUcF0uqL0MM/SiScknLlMII/AAAAAAAAAeA/d0chFZPahjA/s800/20090602_1.jpg"><img class="alignnone" src="http://lh4.ggpht.com/_HUcF0uqL0MM/SiScknLlMII/AAAAAAAAAeA/d0chFZPahjA/s800/20090602_1.jpg" alt="" width="471" height="288" /></a></p>
<p><span style="color: #ff0000;">首先請<span style="color: #ff0000;">先用 </span></span><span style="color: #ff0000;">OSCommeric</span><span style="color: #ff0000;"><span style="color: #ff0000;"> 備份</span>你的資料庫，備份完後請先用文字檔確認內容沒有亂碼。(很重要，後面會用到)</span></p>
<p>接下來在下面2個檔案中修改程式</p>
<p>osc/includes/application_top.php<br />
osc/admin/includes/application_top.php</p>
<p>找到<br />
tep_db_connect() or die('Unable to connect to database server!');</p>
<p>修改成下面這個樣子<span style="color: #ff0000;">(2個檔案都要修改)</span></p>
<p>tep_db_connect() or die('Unable to connect to database server!');<br />
if (substr(mysql_get_server_info(), 0, 3) &gt;= '4.1') {<br />
tep_db_query("SET NAMES 'UTF8'");<br />
}</p>
<p>改完後你會發現原來正常顯示的資料都變成亂碼，不用緊張</p>
<p>這時候再把我們之前備份的資料庫再還原回去<span style="color: #ff0000;">(再次提醒還原前一定要確認備份的檔案內容是正常的，沒有亂碼的)</span></p>
<p>還原完成後，資料庫與網頁的顯示就都正常了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.minitw.com/archives/407/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解決 OSCommeric 在 PHP5 上執行的問題</title>
		<link>http://www.minitw.com/archives/375</link>
		<comments>http://www.minitw.com/archives/375#comments</comments>
		<pubDate>Mon, 27 Apr 2009 04:11:06 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[OSCommeric]]></category>
		<category><![CDATA[OSC]]></category>
		<category><![CDATA[PHP5]]></category>

		<guid isPermaLink="false">http://www.minitw.com/?p=375</guid>
		<description><![CDATA[如果你是使用 KMD 的 OSCommeric 在 PHP5 上執行會有一些小問題 在後台按下 "客戶/訂單" 會出現下面的訊息 Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/osc/admin/customers.php on line 763 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/osc/admin/customers.php on line 765 Warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/osc/admin/includes/classes/object_info.php on line 17 Warning: [...]]]></description>
			<content:encoded><![CDATA[<p>如果你是使用 KMD 的 OSCommeric 在 PHP5 上執行會有一些小問題</p>
<p>在後台按下 "客戶/訂單" 會出現下面的訊息</p>
<p>Warning: array_merge() [function.array-merge]: Argument #1 is not an array in<br />
/var/www/osc/admin/customers.php on line 763</p>
<p>Warning: array_merge() [function.array-merge]: Argument #2 is not an array in<br />
/var/www/osc/admin/customers.php on line 765</p>
<p>Warning: reset() [function.reset]: Passed variable is not an array or object in<br />
/var/www/osc/admin/includes/classes/object_info.php on line 17</p>
<p>Warning: Variable passed to each() is not an array or object in<br />
/var/www/osc/admin/includes/classes/object_info.php on line 18</p>
<p>要解決此問題要修正2個檔案</p>
<p>在 admin/customers.php 中找到下面程式</p>
<p>line 7XX: $customer_info = array_merge($country, $info, $reviews);<br />
line 7XX: $cInfo_array = array_merge($customers, $customer_info); </p>
<p>修改成</p>
<pre class="brush: php; title: ;">
$customer_info = array_merge((array)$country, (array)$info, (array)$reviews);
$cInfo_array = array_merge((array)$customers, (array)$customer_info);
</pre>
<p>---------------------------------------------------------------------------------------<br />
在 admin/includes/classes/object_info.php 中找到下面程式</p>
<p>class objectInfo {<br />
// class constructor<br />
    function objectInfo($object_array) {<br />
      reset($object_array);<br />
      while (list($key, $value) = each($object_array)) {<br />
        $this->$key = tep_db_prepare_input($value);<br />
      }<br />
    }<br />
  }</p>
<p>修改成</p>
<pre class="brush: php; title: ;">
class objectInfo {
    function objectInfo($object_array) {
        $object_array = is_array($object_array) ? $object_array : array($object_array);
        reset($object_array);
        while(list($key, $value) = each($object_array)) {
            $this-&gt;$key = tep_db_prepare_input($value);
        }
    }
}
</pre>
<p>這就子就解決了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.minitw.com/archives/375/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

