基本上 此情形只會出現在BIG5論壇
演示 http://discuz.bluelovers.net/search.php?srchfid=14
搜尋 以閱
修正前會出現已下錯誤Discuz! info: MySQL Query Error
User: 湯姆維德
Time: 2007-12-18 1:23am
Script: /search.php
Query :
SQL: INSERT INTO Discuz_searchindex (keywords, searchstring, useip, uid, dateline, expiration, threads, tids)
VALUES ('已閱', 'title|已閱\|0||\'75\',\'76\',\'59\',\'77\',\'1\',\'12\',\'68\',\'54\',\'55\',\'58\',\'57\',\'64\',\'18\',\'69\',\'51\',\'72\',\'70\',\'82\',\'45\',\'78\',\'81\',\'79\',\'56\',\'61\',\'60\',\'67\',\'33\',\'32\',\'10\',\'27\',\'66\',\'65\',\'14\',\'50\',\'48\',\'49\',\'30\',\'73\',\'71\',\'7\',\'28\',\'17\',\'21\',\'24\',\'15\',\'16\',\'22\',\'25\',\'43\',\'80\',\'20\',\'19\',\'29\',\'26\',\'44\',\'5\',\'39\',\'38\',\'37\',\'47\',\'34\',\'40\',\'46\',\'42\',\'31\',\'3\',\'86\',\'87\'|0|0|all|', '61.216.2.163', '8242', '1197912230', '1197915830', '1', '0,2130')
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'title|已閱\|0||\'75\',\'76\',\'59\',\'77\',\'1\',\'12\',\'68\',\'54\',\'55\',\'5' at line 2
Errno.: 1064
Detail: SQL語句中有錯誤開啟 search.php$keywords = str_replace('%', '+', $srchtxt).(trim($srchuname) ? '+'.str_replace('%', '+', $srchuname) : '');[/php]
下加
[php]// bluelovers
$keywords = addslashes($keywords);
// bluelovers |