Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default UPPERCASE and Lowercase words in SQL

    I am trying to modify an SQL file for a plugin I am developing. The SQL file I am looking at has UPPERCASE & lowercase characters for the same word, e.g. page. Is there a programming reason for this or is just to make it easier to read/follow?

    I am doing this on my phone so I cannot copy the code in to here. The SQL file can be found in plugin called Add Pages to More Info Sidebox.
    Learning Fast.
    Eden Craft Supplies

  2. #2
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: UPPERCASE and Lowercase words in SQL

    It really depends on where in the sql the statement/word is used...
    For example there is no difference in operation of the following two statements:
    Code:
    select * from products where products_id = 1;
    And
    Code:
    SELECT * FROM products WHERE products_id = 1;
    However, the configuration of the system and on which device type it is installed plays a factor on whether capitalization matters.
    Generally speaking, the table(s) name and field designation(s) are lower case. SQL commands can be upper case which tends to make them stand out and understandable that they are "construct" related and not datatable related.

    The value assigned to a field designation may have capital letters in it though also, an underscore is a good "divider" and ensures that a unique character is used and reduces the likelihood of a problem occurring by accidental differences in capitalization.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,715
    Plugin Contributions
    123

    Default Re: UPPERCASE and Lowercase words in SQL

    Looking at the plugin you mentioned
    https://www.zen-cart.com/downloads.php?do=file&id=787

    We can consider this statement
    Code:
    insert into configuration (configuration_title, configuration_key, configuration_value,
    configuration_description, configuration_group_id, sort_order, last_modified, date_added,
    use_function, set_function) values ('Define Page 5', 'DEFINE_PAGE_5_STATUS', '1', 'Enable
    the Defined Page 5 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define
    Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', '25', '85',
    now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');
    The string 'Define Page 5' is a character string that shows up in the configuration menu.
    The string 'DEFINE_PAGE_5_STATUS' is a reference to a PHP defined constant.

    Does that help?
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UPPERCASE and Lowercase words in SQL

    I think I understand what you both have written
    Learning Fast.
    Eden Craft Supplies

 

 

Similar Threads

  1. v155 Lowercase URLs and Currencies
    By RedSpinnaker in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 5
    Last Post: 16 Feb 2017, 01:51 AM
  2. Name disappears if all lowercase?
    By soyabeane in forum General Questions
    Replies: 3
    Last Post: 14 May 2009, 05:14 AM
  3. CSS Button Text...Changes to lowercase
    By absoluteblock in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Jan 2007, 10:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR