SELECT * FROM contents_description WHERE content_id = 169 AND language = 'zh_cn' ORDER BY id LIMIT 1 执行错误

178.          
179.          $result $this->db->query($sql);
180. 
181.          if($result===false)
182.              //echo "查询出错!{$sql}";
183.              JError("{$sql} 执行错误");
184.              
185.          $this->lastResult $result;
186.          return $result;
187.      }
188.      
57.       */
58.      public function getArray($sql)
59.      {
60.          $this->arrSql[] = $sql;
61.          
62.          $result $this->exec($sql);
63.          //make sure the result is valid
64.          if($result=== false || $result===NULL
65.              return NULL;        // error
66.          if(!is_object($result)) // no rows returned
67.              return array();
129.          }elseif(trim($this->pk)!=''){
130.              $sort "ORDER BY {$this->pk}";
131.          }
132.          $sql "SELECT {$fields} FROM {$this->tbl_name} {$where} {$sort}";
133.          if(null != $limit)$sql $this->_db->setlimit($sql$limit);
134.          return $this->_db->getArray($sql);
135.      }
136.      
137.      /**
138.       过滤转义字符
139.       *
85.       * @param sort    排序,等同于“ORDER BY ”
86.       * @param fields    返回的字段范围,默认为返回全部字段的值
87.       */
88.      public function getOne($conditions null$sort null$fields null)
89.      {
90.          if( $record $this->getAll($conditions$sort$fields1) ){
91.              return array_pop($record);
92.          }else{
93.              return FALSE;
94.          }
95.      }
22.      function showAction() {
23.          $content_id intval($this->JArgs('content_id'));
24.          $language$this->getLang();
25.          
26.          $contents_description JLoadClass('contents_description');
27.          if($content_description $contents_description->getOne(array('content_id' => $content_id'language' => $language))) {
28.              $cdid intval($content_description['id']);
29.              $contents_description->incrField(array('id'=>$cdid), 'hits');
30. 
31.              $model $content_description['model'];
32.              $model_obj JLoadClass($model);
26.          eval($GLOBALS['G_JCONFIG']["dispatcher_error"]);
27.          exit;
28.      }
29. 
30.      // 执行用户代码    
31.      $__handle_controller->$__actionFunc();
32. 
33.      //显示前执行自定义代码
34.      JInject("before_display");
35. 
36.      // 控制器程序运行完毕,进行模板的自动输出
63.  if(count($server_info) > 1) {
64.      $server_domain $server_info[count($server_info)-2];
65.      define('DOMAIN'$server_domain);
66.  }
67. 
68.  JStart();
69.  ?>