[問題] 2.0.17 MS ACCESS & MSSQL 問題疑難排解(已解決)

phpBB Installation & Usage Support
phpBB 2 安裝於各類型作業平台之問題討論;外掛問題,請到相關版面依發問格式發表!
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

版面規則
本區是討論關於 phpBB 2.0.X 架設安裝上的問題,只要有安裝任何外掛,請到外掛討論相關版面按照公告格式發表。
(發表文章請按照公告格式發表,違者砍文)
主題已鎖定
fish1984
星球普通子民
星球普通子民
文章: 6
註冊時間: 2005-08-19 13:35

[問題] 2.0.17 MS ACCESS & MSSQL 問題疑難排解(已解決)

文章 fish1984 »

◎主機作業系統:Win2003 Ser
◎上網方式:學術網\r
◎安裝的程式:IIS6x + ODBC_ACCESS
◎phpBB2版本:2.0.17
◎domainl:SFWPRO.com
◎phpBB2網址:http://phpbb.sfwpro.com
◎以上備註,論壇上的設置及安裝上是沒有任何問題滴!!

目前測試全新的 2.0.17 版本資料庫採用 MS ACCESS.
完工後實測發生的問題,下面提出. (該問題僅在ACCESS上出現)

在文章發表中寫入特定字元如下:(這個錯誤是"一"字元出現)

代碼: 選擇全部

測試一下~~
將會出現如下的錯誤訊息:

代碼: 選擇全部

Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] 查詢運算式 'word_text IN ('測試', '測試?)' 中的 字串語法錯誤。, SQL state 37000 in SQLExecDirect in C:\Server_Files\php_demo\db\msaccess.php on line 120 

Warning: Cannot modify header information - headers already sent by (output started at C:\Server_Files\php_demo\db\msaccess.php:120) in C:\Server_Files\php_demo\includes\page_header.php on line 475 

Warning: Cannot modify header information - headers already sent by (output started at C:\Server_Files\php_demo\db\msaccess.php:120) in C:\Server_Files\php_demo\includes\page_header.php on line 477 

Warning: Cannot modify header information - headers already sent by (output started at C:\Server_Files\php_demo\db\msaccess.php:120) in C:\Server_Files\php_demo\includes\page_header.php on line 478 
該問題發生在部份中文字元傳入時發生錯誤,若是將上面的文字轉換為HTML十進位標記法如下:

代碼: 選擇全部

& #28204;& #35430;& #19968;& #19979;~~
就能完成正常送出文件.


該問題已經解決,方法如下:
開啟 includes\functions_search.php 文件 92~103行修正如下.
英文的部份是說,若是有問題的話請修改如下.

代碼: 選擇全部

function split_words(&$entry, $mode = 'post')
{
	// If you experience problems with the new method, uncomment this block.
	
	$rex = ( $mode == 'post' ) ? "/\b([\w±µ-ÿ][\w±µ-ÿ']*[\w±µ-ÿ]+|[\w±µ-ÿ]+?)\b/" : '/(\*?[a-z0-9±µ-ÿ]+\*?)|\b([a-z0-9±µ-ÿ]+)\b/';
	preg_match_all($rex, $entry, $split_entries);

	return $split_entries[1];

	// Trim 1+ spaces to one space and split this trimmed string into words.
	//return explode(' ', trim(preg_replace('#\s+#', ' ', $entry)));
}
主題已鎖定

回到「phpBB 2 安裝與使用」