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



  • 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.



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



  • @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 ).



  • 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. : )


Log in to reply