...

View Full Version : mysql Attributes



conware
04-14-2011, 06:35 PM
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.

Old Pedant
04-14-2011, 09:18 PM
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?"

conware
04-15-2011, 09:46 PM
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.

Old Pedant
04-15-2011, 10:40 PM
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/en/data-type-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/en/numeric-type-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.

guelphdad
04-16-2011, 08:55 AM
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.

conware
04-16-2011, 07:21 PM
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.

Old Pedant
04-16-2011, 09:35 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum