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 = 1153 and c.private=0 ORDER BY c.time desc) sp_tmp_table_pager1
执行错误: Table 'qblog.th_collect' doesn't exist

57.      {
58.          $this->arrSql[] = $sql;
59.          if( $result mysql_query($sql$this->conn) ){
60.              return $result;
61.          }else{
62.              spError("{$sql}<br />执行错误: " mysql_error());
63.          }
64.      }
65.      
66.      /**
67.       返回影响行数
21.       
22.       * @param sql  执行的SQL语句
23.       */
24.      public function getArray($sql)
25.      {
26.          if( ! $result $this->exec($sql) )return FALSE;
27.          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);
207.       *
208.       * @param sql 字符串,需要进行查找的SQL语句
209.       */
210.      public function findSql($sql)
211.      {
212.          return $this->_db->getArray($sql);
213.      }
214. 
215.      /**
216.       执行SQL语句,相等于执行新增,修改,删除等操作。
217.       *
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.              $total_count array_poparray_pop$this->model_obj->findSql("SELECT COUNT({$this->model_obj->pk}) as sp_counter FROM ($conditions) sp_tmp_table_pager1") ) );
559.          }else{
560.              $total_count $this->model_obj->findCount($conditions);
561.          }
562.          if($total_count $pageSize){
563.              $total_page ceil$total_count $pageSize );
421.      /**
422.       魔术函数,支持多重函数式使用类的方法
423.       */
424.      public function __call($func_name$func_args){
425.          if( ( 'findAll' == $func_name || 'findSql' == $func_name ) && != $this->input_args[0]){
426.              return $this->runpager($func_name$func_args);
427.          }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.          }
50.                  SELECT group_concatf.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.          $this->collections spClass('db_collection')->spPager($this->spArgs('page',1),20)->findSql($sql);
56.          $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');
50.                  SELECT group_concatf.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.          $this->collections spClass('db_collection')->spPager($this->spArgs('page',1),20)->findSql($sql);
56.          $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');
16.      if(!is_object($handle_controller) || !method_exists($handle_controller$__action)){
17.          eval($GLOBALS['G_SP']["dispatcher_error"]);
18.          exit;
19.      }
20.      // 路由并执行用户代码
21.      $handle_controller->$__action();
22.      // 控制器程序运行完毕,进行模板的自动输出
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);
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.  spRun();
20.  ?>