Chinaunix首页 | 论坛 | 博客
  • 博客访问: 421609
  • 博文数量: 78
  • 博客积分: 1527
  • 博客等级: 上尉
  • 技术积分: 830
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-27 20:57
文章分类

全部博文(78)

文章存档

2011年(1)

2008年(12)

2007年(53)

2006年(12)

我的朋友

分类:

2008-01-11 15:04:23

 is a simple web stats analyser for wordpress.

in the version 0.9.2,it display wordpress database error:

WordPress database 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 ” at line 3]
SELECT `tp`.`post_title` FROM `wp_posts` AS `tp` WHERE (1 = 1) AND `tp`.`ID` =

I google this problem and find then answer at  in Chinese.

I changed wp-slimstat.php as that article said,then it works fine.

at the line 1716 of wp-slimstat.php,the original code as follow:

" AND `tp`.`ID` = " . $myFieldsList [ $aFieldIndex ];

modification:

" AND `tp`.`ID` = " . $myFieldsList [ $aFieldIndex-1 ];

The reason leading this error is:

This plugin will read WordPress’s Option “permalink_structure”,for example,my is “/archive/%post_id%”,so the Regular Expressions  is

$myPermalinkRegEx = "/archive/([0-9]+)"

matching the content of $resource,creating $myFieldsList. For exampl,"/archive/147”,

$myFieldsList = array("0"="/archive/147", "1"="147")

corresponding is :

$myPermalinkArray = array("0"="", "1"="archive", "2"="%post_id%")

so it needs $aFieldIndex -1 to choose the value of  myFieldsList 147. 

阅读(1166) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~