Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

MySQL Data Type Names

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by 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.
GoDaddyGoDaddy
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
•••
Appraise.net

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back