Unstoppable Domains

MySQL Data Type Names

Spaceship Spaceship
Watch

abc123ben

Established Member
Impact
2
Hello,

I'm currently learning PHP & MySQL from a PHP & MySQL book, and I'm currently learning about MySQL data type names. I'm a bit confused about a particular bit in this section.

ENUM ("val1" , "val2") - What is this data type used for?

Is it something to do with a PHP value? Like this is a variable and value $something = "something" and "something" is the value? And so ENUM ("something") would store the value in the database?

If someone could help, it would be appreciated :).

Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Simply put the ENUM type is used for columns which are to hold only a restricted set of known values. Example:
You can set a column to ENUM('Y','N') for storying yes/no responses (this is used by mySQL itself in its system tables). It means values other than Y or N will not be allowed in that field.
 
0
•••
Thank you. :) That cleared things up :).
 
0
•••
0
•••
Will do. Thanks :).
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back