Mysql 中的field types
04月 17th, 2010 | Published in php+mysql
就是mysql中填入数据的数据类型:
|
MySQL Field Type |
Description |
Description |
|
char(length) |
Customer’s State field |
Any character can be in this field, but |
|
varchar(length) |
Any character can be in this field, and |
Customer’s Address field will has letters and numbers and varies in length. |
|
int(length) |
Numeric field that stores integers |
Quantity of a product on hand. |
|
int(length) |
Unsigned Numeric field that stores positive |
Customer ID (if entirely numerical). |
|
text |
Any character can be in this field, and |
Comments field that allows longer text to be stored, without limiting |
|
decimal(length,dec) |
Numeric field that can store decimals. |
Prices. |
|
enum(“option1”,“option2”, . . .) |
Allows only certain values to be stored |
Gender field for your users will have a value of either “male” or “female.” |
|
date |
Stores a date as yyyy-mm-dd. |
Date of order, birthday, date |
|
time |
Stores time as hh:mm:ss. |
Time a news article was |
|
datetime |
Multipurpose field that stores date and |
Last date and time a user visited your Web page. |
