SELECT * FROM appdata WHERE linkid like '%1941,%' and type = 'recommend' ORDER BY id desc
执行错误: MySQL server has gone away

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 array();
27.          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);
98.          }else{
99.              $sort "ORDER BY {$this->pk}";
100.          }
101.          $sql "SELECT {$fields} FROM {$this->tbl_name} {$where} {$sort}";
102.          if(null != $limit)$sql $this->_db->setlimit($sql$limit);
103.          return $this->_db->getArray($sql);
104.      }
105.      /**
106.       过滤转义字符
107.       *
108.       * @param value 需要进行过滤的值
456.              if('findSql'==$func_name)$conditions $this->model_obj->_db->setlimit($conditions$limit);
457.          }
458.          if('findSql'==$func_name){
459.              return $this->model_obj->findSql($conditions);
460.          }else{
461.              return $this->model_obj->findAll($conditions$sort$fields$limit);
462.          }
463.      }
464.  }
465. 
466.  /**
408.      /** 
409.       魔术函数,支持多重函数式使用类的方法
410.       */
411.      public function __call($func_name$func_args){
412.          if( ( 'findAll' == $func_name || 'findSql' == $func_name ) && != $this->input_args[0]){
413.              return $this->runpager($func_name$func_args);
414.          }elseif(method_exists($this,$func_name)){
415.              return call_user_func_array(array($this$func_name), $func_args);
416.          }else{
417.              return call_user_func_array(array($this->model_obj$func_name), $func_args);
418.          }
43.         else
44.         {
45.            $conditions "linkid like '%".htmlspecialchars($linkid).",%' and type = '".$type."'";
46.         }
47.         
48.         $appdataall =  $appdataObj->spPager($this->spArgs('page'1), 10)->findAll($conditions,"id desc");
49.         foreach ($appdataall as $key => $appval) {
50.            $conditions_reply = array( 'typelinkid' => $appval['id'], 'types' => 'appdata',);
51.            $replynum $lib_replyinfo->findCount($conditions_reply);
52.            $appdataall[$key]['replynum'] = $replynum;
53.         }
43.         else
44.         {
45.            $conditions "linkid like '%".htmlspecialchars($linkid).",%' and type = '".$type."'";
46.         }
47.         
48.         $appdataall =  $appdataObj->spPager($this->spArgs('page'1), 10)->findAll($conditions,"id desc");
49.         foreach ($appdataall as $key => $appval) {
50.            $conditions_reply = array( 'typelinkid' => $appval['id'], 'types' => 'appdata',);
51.            $replynum $lib_replyinfo->findCount($conditions_reply);
52.            $appdataall[$key]['replynum'] = $replynum;
53.         }
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);
53.          ),
54.       )
55.  );
56.  require(SP_PATH."/SpeedPHP.php");
57.  import(APP_PATH.'/controller/tplbasis.php'); // 需要先载入top控制器父类
58.  spRun();