SELECT COUNT(article_id) AS SP_COUNTER FROM cms_article WHERE pattern_id= and cat_id=10
执行错误: 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 'and cat_id=10' at line 1
- /home/cwummide/public_html/SpeedPHP/Drivers/mysql.php on line 62
57.
{
58.
$this->arrSql[] = $sql;
59.
if( $result = mysql_query($sql, $this->conn) ){
60.
return $result;
61.
}else{
62.
63.
spError("{$sql}<br />执行错误: " . mysql_error());
}
64.
}
65.
66.
/**
67.
* 返回影响行数
- /home/cwummide/public_html/SpeedPHP/Drivers/mysql.php on line 26
21.
*
22.
* @param sql 执行的SQL语句
23.
*/
24.
public function getArray($sql)
25.
{
26.
27.
if( ! $result = $this->exec($sql) )return array();
if( ! mysql_num_rows($result) )return array();
28.
$rows = array();
29.
while($rows[] = mysql_fetch_array($result,MYSQL_ASSOC)){}
30.
mysql_free_result($result);
31.
array_pop($rows);
- /home/cwummide/public_html/SpeedPHP/Core/spModel.php on line 295
290.
if(null != $conditions)$where = "WHERE ".$conditions;
291.
}
292.
$this->pk=isset($this->pk)?$this->pk:"*";
293.
$sql = "SELECT COUNT({$this->pk}) AS SP_COUNTER FROM {$this->tbl_name} {$where}";
294.
295.
296.
$result = $this->_db->getArray($sql);
return $result[0]['SP_COUNTER'];
297.
}
298.
299.
/**
300.
* 魔术函数,执行模型扩展类的自动加载及使用
- /home/cwummide/public_html/controller/article.php on line 62
57.
58.
//根据条件获得栏目所有子级ID
59.
$idstr = $cat->getIds($cid);
60.
$condition = empty($idstr) ? "pattern_id={$pattern_id} and cat_id=" . $cid : "pattern_id={$pattern_id} and (cat_id=" . $cid . " or cat_id in (" . $idstr . "))";
61.
62.
63.
$articlecount = $article->findCount($condition) - 1;
64.
$this->articlefirst = $article->find($condition, "adddate desc");
65.
$this->articlelist = $article->spPager($this->spArgs('page', 1), $pagesize)->findAll($condition, "adddate desc", "article_id,article_title,article_content,adddate,hitcount,article_pic");
66.
$this->pager = $article->spPager()->getPager();
67.
if ($this->pager) {
- /home/cwummide/public_html/SpeedPHP/spFunctions.php on line 21
16.
if(!is_object($handle_controller) || !method_exists($handle_controller, $__action)){
17.
eval($GLOBALS['G_SP']["dispatcher_error"]);
18.
exit;
19.
}
20.
// 路由并执行用户代码
21.
22.
$handle_controller->$__action();
// 控制器程序运行完毕,进行模板的自动输出
23.
if(FALSE != $GLOBALS['G_SP']['view']['auto_display']){
24.
$__tplname = $__controller.$GLOBALS['G_SP']['view']['auto_display_sep'].
25.
$__action.$GLOBALS['G_SP']['view']['auto_display_suffix']; // 拼装模板路径
26.
$handle_controller->auto_display($__tplname);
- /home/cwummide/public_html/index.php on line 13
8.
//require(SP_PATH."/config.php"); //载入配置文件
9.
ini_set("error_reporting","E_ALL & ~E_NOTICE");
10.
11.
require(SP_PATH."/SpeedPHP.php");
12.
require(SP_PATH."/Extensions/cyFunctions.php");
13.
14.
spRun();
15.
?>