Dynadot โ€” .com Transfer

MySQL Data Type Names

SpaceshipSpaceship
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.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
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 TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back