Community
    • Login

    Why is "depth" highlighted in an *.sql file?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Pete NorrisP
      Pete Norris
      last edited by Pete Norris

      Hellp Npp forum!

      Question: Why is the word “depth” highlighted in an .sql file?

      Below is an mysql database table. The column heading “depth” displays in bold blue in my Notepad++ window. The code below is in an .sql file.

      I have checked the PHP manual and the MySQL manual. The word “depth” is not a reserved word or a keyword in either php or mysql.

      I have got a screen shot but I can’t figure out how to insert an image in a post on this forum.

      CREATE TABLE IF NOT EXISTS categories (
      cat_id smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT ‘Specific id for each of the categories.’,
      main_id smallint(5) unsigned DEFAULT NULL,
      parent_id smallint(5) unsigned DEFAULT NULL,
      children varchar(255) DEFAULT NULL,
      **depth** tinyint(4) DEFAULT NULL,
      category varchar(255) DEFAULT NULL COMMENT ‘’,
      display_cat varchar(255) DEFAULT NULL COMMENT ‘’,
      PRIMARY KEY (cat_id),
      KEY parent_id (parent_id),
      KEY category (category),
      KEY depth (depth),
      KEY main_id (main_id)
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

      Thank you in advance.

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • MAPJe71M
        MAPJe71
        last edited by

        It appears to be a reserved word in SQL-99 (see here and here).

        1 Reply Last reply Reply Quote 2
        • Scott SumnerS
          Scott Sumner @Pete Norris
          last edited by Scott Sumner

          @Pete-Norris

          Why is the word “depth” highlighted in an .sql file?

          I don’t know the answer to why? , but you can delete it from the appropriate place in langs.xml (under the “sql” language) and then it will no longer be specially highlighted in bold blue for you.

          This thread will tell you about how to post a screenshot here: https://notepad-plus-plus.org/community/topic/14262/how-to-markdown-code-on-this-forum

          If this (or ANY posting on the Notepad++ Community site) is useful, don’t reply with a “thanks”, simply up-vote ( click the ^ in the ^ 0 v area on the right ).

          1 Reply Last reply Reply Quote 1
          • Pete NorrisP
            Pete Norris
            last edited by

            MAPJe71, Scott Sumner;

            Thank you for responding to my question. I appreciate the help.

            I think it would be a good idea for me to change the column name to a different name.

            Thanks again. : )

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors