mysql> select fid,tid,subject,summary from pre_posts where summary=0 limit 1
;
+-----+-----+--------------------------------------------+----------------------
+
| fid | tid | subject                                    | summary
|
+-----+-----+--------------------------------------------+----------------------
+
|  19 |  34 | 关于假体丰胸手术具体有哪些亮点广州丰胸整型 | 导读:丰胸用什么方法
|
+-----+-----+--------------------------------------------+----------------------
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+----------------------------------------------------------+
| Level   | Code | Message                                                  |
+---------+------+----------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: '导读:丰胸用什么方法' |
+---------+------+----------------------------------------------------------+
1 row in set (0.02 sec)为什么出现这样的情况,很奇怪哦

解决方案 »

  1.   

    首先where summary=0 应该是查不出文章才对。
    其次出现Truncated incorrect DOUBLE value这样的警告是怎么回事?
      

  2.   

    summary是varchar(1000)类型。
    请教高手怎么解决这个问题!!
      

  3.   

    summary是varchar(1000)类型
    为什么WHERE 中要用summary=0?
      

  4.   

    mysql> select version();
    +-----------+
    | version() |
    +-----------+
    | 5.5.27    |
    +-----------+
    1 row in set (0.01 sec)
      

  5.   

    0是默认值,另外我查询的时候感觉0比null要快。这个问题网络找遍了,没有一个人遇到过,太奇怪了。
      

  6.   

    都是GBKmysql> show global variables like '%character%';
    +--------------------------+---------------------------------------------------
    -----+
    | Variable_name            | Value
         |
    +--------------------------+---------------------------------------------------
    -----+
    | character_set_client     | gbk
         |
    | character_set_connection | gbk
         |
    | character_set_database   | gbk
         |
    | character_set_filesystem | binary
         |
    | character_set_results    | gbk
         |
    | character_set_server     | gbk
         |
    | character_set_system     | utf8
         |
    | character_sets_dir       | D:\Program Files\MySQL\MySQL Server 5.5\share\char
    ets\ |
    +--------------------------+---------------------------------------------------
    -----+
    8 rows in set (0.02 sec)
      

  7.   

    show create table pre_posts ;这个也需要贴出来以供分析。
      

  8.   

    | pre_posts | CREATE TABLE `pre_posts` (
      `pid` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `fid` smallint(6) unsigned NOT NULL DEFAULT '0',
      `tid` mediumint(8) unsigned NOT NULL DEFAULT '0',
      `first` tinyint(1) NOT NULL DEFAULT '0',
      `author` varchar(15) NOT NULL DEFAULT '',
      `authorid` mediumint(8) unsigned NOT NULL DEFAULT '0',
      `subject` varchar(80) NOT NULL DEFAULT '',
      `dateline` int(10) unsigned NOT NULL DEFAULT '0',
      `message` mediumtext NOT NULL,
      `useip` varchar(15) NOT NULL DEFAULT '',
      `invisible` tinyint(1) NOT NULL DEFAULT '0',
      `anonymous` tinyint(1) NOT NULL DEFAULT '0',
      `usesig` tinyint(1) NOT NULL DEFAULT '0',
      `htmlon` tinyint(1) NOT NULL DEFAULT '0',
      `bbcodeoff` tinyint(1) NOT NULL DEFAULT '0',
      `smileyoff` tinyint(1) NOT NULL DEFAULT '0',
      `parseurloff` tinyint(1) NOT NULL DEFAULT '0',
      `attachment` tinyint(1) NOT NULL DEFAULT '0',
      `rate` smallint(6) NOT NULL DEFAULT '0',
      `ratetimes` tinyint(3) unsigned NOT NULL DEFAULT '0',
      `status` tinyint(1) NOT NULL DEFAULT '0',
      `summary` varchar(1000) NOT NULL DEFAULT '0',
      PRIMARY KEY (`pid`),
      KEY `fid` (`fid`),
      KEY `authorid` (`authorid`),
      KEY `dateline` (`dateline`),
      KEY `invisible` (`invisible`),
      KEY `displayorder` (`tid`,`invisible`,`dateline`),
      KEY `first` (`tid`,`first`)
    ) ENGINE=MyISAM AUTO_INCREMENT=2415646 DEFAULT CHARSET=gbk |都是GBK,很奇怪。首先第一个问题就感觉很不解,为什么mysql> select fid,tid,subject,summary from pre_posts where summary=0 limit 1
    ;
    +-----+-----+--------------------------------------------+----------------------
    +
    | fid | tid | subject | summary
    |
    +-----+-----+--------------------------------------------+----------------------
    +
    | 19 | 34 | 关于假体丰胸手术具体有哪些亮点广州丰胸整型 | 导读:丰胸用什么方法查询出来的东西,是这样的?太不可思议了。
      

  9.   

    where summary='0'
    结果如何
      

  10.   

    这个结果是没有数据。但,确实有summary的内容,却显示不出来?
      

  11.   

    再顶下一下这个奇怪的问题
    where summary=0明明是0,为什么可以查询出有内容的summary呢?