Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2010
    Posts
    199
    Thanks
    78
    Thanked 5 Times in 5 Posts

    mysql Attributes

    Hi everyone, mabey a silly question but I wondering what the purpose of mysql Attributes are.
    How should one use them and what do the do.
    Ive never really found a good explanation on it.

    Thanks for taking the time to post a reply.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,506
    Thanks
    77
    Thanked 4,378 Times in 4,343 Posts
    WAY WAY too general a question.

    What KIND of attributes???

    Some are used to set limits on what users can do. Some are used to "tune" the database for a particular kind (or kinds) of queries. Some are used to specify basic features of the server (e.g., hostname or port or or or).

    It's kind of like asking "What are adjectives used for in the English language?"
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Mar 2010
    Posts
    199
    Thanks
    78
    Thanked 5 Times in 5 Posts
    Ah I see, well the thing I was wondering about is in phpmyadmin if you have a table you always have a field calt attributes where you can select: Binary, unsigned, unsigned zerofill, on update CURRENT_TIMESTAMP.
    I was wondering when I should use those fields.
    Ive never really used them for anything in my database thats why I was wondering how to use them. But if its not easy to explain i'll just look into some more on the internet.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,506
    Thanks
    77
    Thanked 4,378 Times in 4,343 Posts
    Oh, *THOSE* kinds of attributes!

    For *fields*. (Or columns...two names for same thing.)

    I don't use phpmysqladmin, so I had never seen them called "attributes" before.

    They really are just part of the TYPE information for a field.

    You might start here:
    http://dev.mysql.com/doc/refman/5.1/en/data-types.html

    And especially here:
    http://dev.mysql.com/doc/refman/5.1/...-overview.html

    And, for numeric types (which are mostly what you were referring to...except for the current_timestamp), look here:
    http://dev.mysql.com/doc/refman/5.1/...-overview.html

    MySQL docs aren't consistent: Sometimes they call things like "unsigned" and "zerofill" attributes and sometimes they call them "properties". I had always used "properties" but I can see where phpmysqladmin got the word "attributes" from, now.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    conware (04-16-2011)

  • #5
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Make your questions clear when you post them. phpmyadmin isn't part of mysql. So if you specify that is what you are using in your first post it gives people a clearer idea of the question you are asking.

    Hope that helps you and others for clearer questions going forward.

  • Users who have thanked guelphdad for this post:

    conware (04-16-2011)

  • #6
    Regular Coder
    Join Date
    Mar 2010
    Posts
    199
    Thanks
    78
    Thanked 5 Times in 5 Posts
    Thanks Old Pedant and sorry for the confusion.
    I thought mysql and phpmyadmin where similar.
    Anway I'll check out the links and thanks for the help

    btw guelphdad i'll be sure to make my questions clear next time Its just I never realized phpmyadmin and mysql are not the same.
    And sins phpmyadmin named the field attributes I figured people would know what I meant sorry for that.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,506
    Thanks
    77
    Thanked 4,378 Times in 4,343 Posts
    But to be fair, even the MySQL docs sometimes use the word "attributes" for these. More common is "properties", but it's certainly a cause for confusion.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •