SELECT COUNT(id) as sp_counter FROM (SELECT c.*,
( SELECT group_concat( f.uid ) FROM `th_follow` as f WHERE c.id = f.tocoid ) as followers,
( SELECT t.cover FROM `th_collect` as t WHERE t.coid = c.id LIMIT 1 ) as c_cover,
( SELECT count( * ) FROM `th_follow` as f WHERE c.id = f.tocoid ) as num
FROM `th_collection` AS c where c.uid = 149134 and c.private=0 ORDER BY c.time desc) sp_tmp_table_pager1
执行错误: Table 'qblog.th_collect' doesn't exist
- D:\wwwroot\www.iguoguo.net\u\init\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.
* 返回影响行数
- D:\wwwroot\www.iguoguo.net\u\init\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);
- D:\wwwroot\www.iguoguo.net\u\init\Core\spModel.php on line 212
207.
*
208.
* @param sql 字符串,需要进行查找的SQL语句
209.
*/
210.
public function findSql($sql)
211.
{
212.
213.
return $this->_db->getArray($sql);
}
214.
215.
/**
216.
* 执行SQL语句,相等于执行新增,修改,删除等操作。
217.
*
- D:\wwwroot\www.iguoguo.net\u\init\Core\spModel.php on line 558
553.
$this->pageData = null;
554.
$page = $this->input_args[0];
555.
$pageSize = $this->input_args[1];
556.
@list($conditions, $sort, $fields ) = $func_args;
557.
if('findSql'==$func_name){
558.
559.
$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") ) );
}else{
560.
$total_count = $this->model_obj->findCount($conditions);
561.
}
562.
if($total_count > $pageSize){
563.
$total_page = ceil( $total_count / $pageSize );
- D:\wwwroot\www.iguoguo.net\u\init\Core\spModel.php on line 426
421.
/**
422.
* 魔术函数,支持多重函数式使用类的方法
423.
*/
424.
public function __call($func_name, $func_args){
425.
if( ( 'findAll' == $func_name || 'findSql' == $func_name ) && 0 != $this->input_args[0]){
426.
427.
return $this->runpager($func_name, $func_args);
}elseif(method_exists($this,$func_name)){
428.
return call_user_func_array(array($this, $func_name), $func_args);
429.
}else{
430.
return call_user_func_array(array($this->model_obj, $func_name), $func_args);
431.
}
- D:\wwwroot\www.iguoguo.net\u\controller\userblog.php on line 55
50.
( SELECT group_concat( f.uid ) FROM `".DBPRE."follow` as f WHERE c.id = f.tocoid ) as followers,
51.
( SELECT t.cover FROM `".DBPRE."collect` as t WHERE t.coid = c.id LIMIT 1 ) as c_cover,
52.
( SELECT count( * ) FROM `".DBPRE."follow` as f WHERE c.id = f.tocoid ) as num
53.
FROM `".DBPRE."collection` AS c where c.uid = ".$uid." and c.private=0 ORDER BY c.time desc";
54.
55.
56.
$this->collections = spClass('db_collection')->spPager($this->spArgs('page',1),20)->findSql($sql);
$this->pager = spClass('db_collection')->spPager()->pagerHtml('userblog','index',array('uid'=>$uid));
57.
$this->user = $user;
58.
$this->title = $user['username'];
59.
$this->cur="collection";
60.
$this->display('user_index.html');
- D:\wwwroot\www.iguoguo.net\u\controller\userblog.php on line 55
50.
( SELECT group_concat( f.uid ) FROM `".DBPRE."follow` as f WHERE c.id = f.tocoid ) as followers,
51.
( SELECT t.cover FROM `".DBPRE."collect` as t WHERE t.coid = c.id LIMIT 1 ) as c_cover,
52.
( SELECT count( * ) FROM `".DBPRE."follow` as f WHERE c.id = f.tocoid ) as num
53.
FROM `".DBPRE."collection` AS c where c.uid = ".$uid." and c.private=0 ORDER BY c.time desc";
54.
55.
56.
$this->collections = spClass('db_collection')->spPager($this->spArgs('page',1),20)->findSql($sql);
$this->pager = spClass('db_collection')->spPager()->pagerHtml('userblog','index',array('uid'=>$uid));
57.
$this->user = $user;
58.
$this->title = $user['username'];
59.
$this->cur="collection";
60.
$this->display('user_index.html');
- D:\wwwroot\www.iguoguo.net\u\init\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);
- D:\wwwroot\www.iguoguo.net\u\index.php on line 19
14.
require(SP_PATH."/init.php");
15.
require(SP_PATH."/Extensions/thFunctions.php");
16.
17.
import(APP_PATH.'/controller/top.php',$auto_search = TRUE, $auto_error = TRUE); //TOP全局控制器
18.
header("Content-type: text/html; charset=utf-8");
19.
20.
spRun();
?>