SELECT * FROM ws_tags WHERE id= ORDER BY id LIMIT 1
执行错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY id LIMIT 1' at line 1

34.          $this->arrSql[] = $sql;
35.          if( $result mysql_query($sql$this->conn) ){
36.              return $result;
37.          }else{
38.              if(mysql_error()!=''){
39.                  syError("{$sql}<br />执行错误: " mysql_error());
40.              }else{
41.                  return TRUE;
42.              }
43.          }
44.      }
3.  class db_mysql {
4.      public $conn;
5.      public $arrSql;
6.      public function getArray($sql)
7.      {
8.          if( ! $result $this->exec($sql) )return array();
9.          if( ! mysql_num_rows($result) )return array();
10.          $rows = array();
11.          while($rows[] = mysql_fetch_array($result,MYSQL_ASSOC)){}
12.          mysql_free_result($result);
13.          array_pop($rows);
50.          }else{
51.              $sort "ORDER BY {$this->pk}";
52.          }
53.          $sql "SELECT {$fields} FROM {$this->tbl_name} {$where} {$sort}";
54.          if(null != $limit)$sql $this->_db->setlimit($sql$limit);
55.          return $this->_db->getArray($sql);
56.      }
57. 
58.      public function escape($value)
59.      {
60.          return $this->_db->__val_escape($value);
22.          if ($this->_db->showtables($value)==0){return TRUE;}else{return FALSE;}
23.      }
24.      
25.      public function find($conditions null$sort null$fields null)
26.      {
27.          if( $record $this->findAll($conditions$sort$fields1) ){
28.              return array_pop($record);
29.          }else{
30.              return FALSE;
31.          }
32.      }
1993. 
1994. 
1995. 
1996.  function list_tags($id,$mold='article'){
1997. 
1998.      $tags=syDB('tags')->find(' id='.$id);
1999. 
2000.      $list=syDB($mold)->findAll(" isshow=1 and tags like '%".$tags['name']."%' ",'orders desc,addtime desc');
2001. 
2002.      foreach ($list as $k=>$v){
2003. 
61. 
62.              <div class="pupd-m pm2">
63. 
64.                  <ul>
65. 
66.                      <?php foreach( list_tags($id) as $v){ ?>
67.                      <li>
68.                          <h6> <a href="/index.php?c=article&id=<?php echo $v['id'?>" class="photo"><img <?php if($v['litpic']){ ?>src="<?php echo $v['litpic'?>"<?php }else{ ?>src="/skin/default/images/moren.png"<?php ?> alt="<?php echo $v['title'?>" /></a></h6>
69.                          <h4><a href="/index.php?c=article&id=<?php echo $v['id'?>">><?php echo newstr($v['title'],30?></a></h4>
70.                          <h3><?php echo newstr($v['description'],90?></h3>
71.                          <h2><?php echo date('Y-m-d',$v['addtime']) ?></h2>
64.          if( $enable_gzip==){
65.              GLOBAL $__template_compression_level;
66.              $__template_compression_level=syExt('enable_gzip_level');
67.              ob_start('template_ob_gzip');
68.          }
69.          include $template_tpl;
70.      }
71.      
72.      private function template_html($content){
73.          preg_match_all('/\{include=\"(.*?)\"\}/si',$content,$i);
74.          foreach($i[0] as $k=>$v){
23.      {
24.          try {
25.                  $this->addfuncs();
26.                  $this->displayed TRUE;
27.                  if($GLOBALS['G_DY']['view']['debugging'] && SP_DEBUG)$this->engine->debugging TRUE;
28.                  $this->engine->display($tplname);
29.          } catch (Exception $e) {
30.              syError$GLOBALS['G_DY']['view']['engine_name']. ' Error: '.$e->getMessage() );
31.          }
32.      }
33. 
25. 
26.      public function display($tplname$output TRUE)
27.      {
28.          @ob_start();
29.          if(TRUE == $GLOBALS['G_DY']['view']['enabled']){
30.              $this->v->display($tplname);
31.          }else{
32.              extract($this->__template_vals);
33.              require($tplname);
34.          }
35.          if( TRUE != $output )return ob_get_clean();
106.              if(!strpos($tags_typess['template'],'.html')!==FALSE){
107.                  message('模板('.$tags_typess['template'].')格式不对!');exit;
108.              }
109.          }
110.          
111.          $this->display('article/'.$tags_typess['template']);
112.          
113.      }
114.      
115.      
116.      function gg(){
26. 
27.          exit;
28. 
29.      }
30. 
31.      $handle_controller->$__action();
32. 
33.      if(FALSE != $GLOBALS['G_DY']['view']['auto_display']){
34. 
35.          $__tplname $__controller.$GLOBALS['G_DY']['view']['auto_display_sep'].
36. 
1.  <?php
2.  require("config.php");
3.  $WSConfig['view']['config']['template_dir'] = APP_PATH.'/template/'.$WSConfig['ext']['view_themes'];
4.  require(WS_PATH."/sys.php");
5.  spRun();