SELECT COUNT(id) AS SP_COUNTER FROM sp_article WHERE pid in ()
执行错误: 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 1
- C:\ftp\www\www\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.
* 返回影响行数
- C:\ftp\www\www\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 FALSE;
if( ! mysql_num_rows($result) )return FALSE;
28.
$rows = array();
29.
while($rows[] = mysql_fetch_array($result,MYSQL_ASSOC)){}
30.
mysql_free_result($result);
31.
array_pop($rows);
- C:\ftp\www\www\SpeedPHP\Core\spModel.php on line 275
270.
$where = "WHERE ".join(" AND ",$join);
271.
}else{
272.
if(null != $conditions)$where = "WHERE ".$conditions;
273.
}
274.
$sql = "SELECT COUNT({$this->pk}) AS SP_COUNTER FROM {$this->tbl_name} {$where}";
275.
276.
$result = $this->_db->getArray($sql);
return $result[0]['SP_COUNTER'];
277.
}
278.
279.
/**
280.
* 魔术函数,执行模型扩展类的自动加载及使用
- C:\ftp\www\www\SpeedPHP\Core\spModel.php on line 456
451.
$pageSize = $this->input_args[1];
452.
@list($conditions, $sort, $fields ) = $func_args;
453.
if('findSql'==$func_name){
454.
$total_count = array_pop( array_pop( $this->model_obj->findSql("SELECT COUNT({$this->model_obj->pk}) as sp_counter FROM ($conditions) sp_tmp_table_pager1") ) );
455.
}else{
456.
457.
$total_count = $this->model_obj->findCount($conditions);
}
458.
if($total_count > $pageSize){
459.
$total_page = ceil( $total_count / $pageSize );
460.
$page = min(intval(max($page, 1)), $total_count); // 对页码进行规范运算
461.
$this->pageData = array(
- C:\ftp\www\www\SpeedPHP\Core\spModel.php on line 431
426.
/**
427.
* 魔术函数,支持多重函数式使用类的方法
428.
*/
429.
public function __call($func_name, $func_args){
430.
if( ( 'findAll' == $func_name || 'findSql' == $func_name ) && 0 != $this->input_args[0]){
431.
432.
return $this->runpager($func_name, $func_args);
}elseif(method_exists($this,$func_name)){
433.
return call_user_func_array(array($this, $func_name), $func_args);
434.
}else{
435.
return call_user_func_array(array($this->model_obj, $func_name), $func_args);
436.
}
- C:\ftp\www\www\modules\index\news.php on line 32
27.
foreach($news_cate_ids as $k=>$v){
28.
$all_ids[] = $news_cate_ids[$k]['id'];
29.
}
30.
$all_ids = implode(",",$all_ids);
31.
32.
33.
$this->news_all_list = spClass("article_list")->spPager($this->spArgs('page', 1), NUMS_PER_PAGE)->findAll("pid in (".$all_ids.")");
34.
$this->pager = spClass('article_list')->spPager()->getPager();
35.
//print_r($this->news_all_list);
36.
$you = spClass("article_cat")->find("id='".NEWS_CATE_ID."'");
37.
$this->titleweb = $you['catename'];
- C:\ftp\www\www\modules\index\news.php on line 32
27.
foreach($news_cate_ids as $k=>$v){
28.
$all_ids[] = $news_cate_ids[$k]['id'];
29.
}
30.
$all_ids = implode(",",$all_ids);
31.
32.
33.
$this->news_all_list = spClass("article_list")->spPager($this->spArgs('page', 1), NUMS_PER_PAGE)->findAll("pid in (".$all_ids.")");
34.
$this->pager = spClass('article_list')->spPager()->getPager();
35.
//print_r($this->news_all_list);
36.
$you = spClass("article_cat")->find("id='".NEWS_CATE_ID."'");
37.
$this->titleweb = $you['catename'];
- C:\ftp\www\www\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);
- C:\ftp\www\www\index.php on line 14
9.
// 当前模块附加的配置
10.
$spConfig['controller_path'] = APP_PATH.'/modules/'.basename(__FILE__,".php");
11.
12.
// 载入SpeedPHP框架
13.
require(SP_PATH."/SpeedPHP.php");
14.
spRun(); // SpeedPHP 3新特性