SELECT * FROM vn_pcat WHERE id = '1' ORDER BY id LIMIT 1
执行错误: 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 需要进行过滤的值
60.       * @param sort    排序,等同于“ORDER BY ”
61.       * @param fields    返回的字段范围,默认为返回全部字段的值
62.       */
63.      public function find($conditions null$sort null$fields null)
64.      {
65.          if( $record $this->findAll($conditions$sort$fields1) ){
66.              return array_pop($record);
67.          }else{
68.              return FALSE;
69.          }
70.      }
888.              }else{
889.                  $fcondition = array($thelinker['fkey']=>$run_result[$thelinker['mapkey']]);
890.              }
891.          }
892.          if(TRUE == $thelinker['countonly'])$do_func "findCount";
893.          return spClass($thelinker['fclass'])->$do_func($fcondition$thelinker['sort'], $thelinker['field'], $thelinker['limit'] );
894.      }
895.  }
752.                      $thelinker['type'] = strtolower($thelinker['type']);
753.                      if( 'find' == $func_name || 'findBy' == $func_name ){
754.                          $run_result[$thelinker['map']] = $this->do_select$thelinker$run_result );
755.                      }elseif( 'findAll' == $func_name || 'run' == $func_name ){
756.                          foreach( $run_result as $single_key => $single_result )
757.                              $run_result[$single_key][$thelinker['map']] = $this->do_select$thelinker$single_result );
758.                      }elseif( 'create' == $func_name ){
759.                          $this->do_create$thelinker$run_result$func_args );
760.                      }elseif( 'update' == $func_name ){
761.                          $this->do_update$thelinker$func_args );
762.                      }elseif( 'delete' == $func_name || 'deleteByPk' == $func_name ){
67.          $condition "visible=1"
68.          $this->remen spClass('m_news')->findAll($condition,'views DESC',null,10);
69. 
70.          
71.          //首页产品7条
72.          $this->xgcp2 spClass('m_prod')->spLinker()->findAll(array('cid'=>1),'stick DESC,odnum DESC,id DESC',null,7);
73.          //所有产品
74.          $this->cp spClass('m_prod')->spLinker()->findAll(array('cid'=>1),'stick DESC,odnum DESC,id DESC');
75. 
76.          //相关置顶产品4条
77.          $condition "apid like '%1%' and visible=1 and stick=1";
67.          $condition "visible=1"
68.          $this->remen spClass('m_news')->findAll($condition,'views DESC',null,10);
69. 
70.          
71.          //首页产品7条
72.          $this->xgcp2 spClass('m_prod')->spLinker()->findAll(array('cid'=>1),'stick DESC,odnum DESC,id DESC',null,7);
73.          //所有产品
74.          $this->cp spClass('m_prod')->spLinker()->findAll(array('cid'=>1),'stick DESC,odnum DESC,id DESC');
75. 
76.          //相关置顶产品4条
77.          $condition "apid like '%1%' and visible=1 and stick=1";
155.          }
156.      }
157.      if(FALSE != $has_define){
158.          $argString '';$comma ''
159.          if(null != $args)for ($i 0$i count($args); $i ++) { $argString .= $comma "\$args[$i]"$comma ', '; } 
160.          eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);"); 
161.          return $GLOBALS['G_SP']["inst_class"][$class_name];
162.      }
163.      spError($class_name."类定义不存在,请检查。");
164.  }
165. 
10.  function spRun(){
11.      GLOBAL $__controller$__action;
12.      // 对路由进行自动执行相关操作
13.      spLaunch("router_prefilter");
14.      // 对将要访问的控制器类进行实例化
15.      $handle_controller spClass($__controllernull$GLOBALS['G_SP']["controller_path"].'/'.$__controller.".php");
16.      // 调用控制器出错将调用路由错误处理函数
17.      if(!is_object($handle_controller) || !method_exists($handle_controller$__action)){
18.          eval($GLOBALS['G_SP']["dispatcher_error"]);
19.          exit;
20.      }
9.  //加载框架核心
10.  require(SP_PATH.'/SpeedPHP.php');
11.  //require('icopylock.com.php');
12.  require('functions.php');
13.  //执行应用
14.  spRun();
15.  ?>