select user from zp_administrators where id=-6 /*!union select password from zp_administrators*/;那个union 居然执行了,这是什么原因啊?是一种什么机制吗?

解决方案 »

  1.   

    会!注意这个号 /*!union select password from zp_administrators*/;
      

  2.   

    手册中如下MySQL Server supports some variants of C-style comments. These enable you to write code that includes MySQL extensions, but is still portable, by using comments of the following form: /*! MySQL-specific code */In this case, MySQL Server parses and executes the code within the comment as it would any other SQL statement, but other SQL servers will ignore the extensions. For example, MySQL Server recognizes the STRAIGHT_JOIN keyword in the following statement, but other servers will not: SELECT /*! STRAIGHT_JOIN */ col1 FROM table1,table2 WHERE ...If you add a version number after the “!” character, the syntax within the comment is executed only if the MySQL version is greater than or equal to the specified version number. The TEMPORARY keyword in the following comment is executed only by servers from MySQL 3.23.02 or higher: CREATE /*!32302 TEMPORARY */ TABLE t (a INT);The comment syntax just described applies to how the mysqld server parses SQL statements. The mysql client program also performs some parsing of statements before sending them to the server. (It does this to determine statement boundaries within a multiple-statement input line.) 
      

  3.   

     下次请直接去google!
    http://www.google.com.sg/language_tools?hl=zh-CN
    以下由GOOGLE自动翻译MySQL Server supports some variants of C-style comments. These enable you to write code that includes MySQL extensions, but is still portable, by using comments of the following form: 
    MySQL服务器支持一些变体的C风格的注释。这使您可以编写代码,其中包括MySQL的扩展,但仍携带,使用以下形式的评论:/*! MySQL-specific code */In this case, MySQL Server parses and executes the code within the comment as it would any other SQL statement, but other SQL servers will ignore the extensions. For example, MySQL Server recognizes the STRAIGHT_JOIN keyword in the following statement, but other servers will not: 
    在这种情况下,MySQL服务器内解析并执行的代码注释,因为任何其他的SQL语句,但其他SQL服务器将忽略扩展。例如,MySQL服务器认识到在下面的语句STRAIGHT_JOIN的关键字,而其他服务器将不会:SELECT /*! STRAIGHT_JOIN */ col1 FROM table1,table2 WHERE ...If you add a version number after the “!” character, the syntax within the comment is executed only if the MySQL version is greater than or equal to the specified version number. The TEMPORARY keyword in the following comment is executed only by servers from MySQL 3.23.02 or higher如果您添加后的“@”字符版本号,内部的注释语法执行仅当MySQL版本大于或等于指定的版本号。在下面的意见执行临时关键字只有从MySQL 3.23.02或更高级的服务器CREATE /*!32302 TEMPORARY */ TABLE t (a INT);The comment syntax just described applies to how the mysqld server parses SQL statements. The mysql client program also performs some parsing of statements before sending them to the server. (It does this to determine statement boundaries within a multiple-statement input line.) 
    注释语法刚刚描述适用于mysqld服务器如何解析SQL语句。 mysql客户端程序还执行,然后发送到服务器的一些发言解析。 (这样做一方面是确定在一个多语句输入行语句边界。)