11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

www.it-ebooks.infoCHAPTER 28 • MYSQL STORAGE ENGINES AND DATA TYPESDECIMAL([M[,D]]) [UNSIGNED] [ZEROFILL]The DECIMAL data type is a floating-point number stored as a string, supporting a signed range of –1.7976931348623157E+308 to –2.2250738585072014E–308 and an unsigned range of 2.2250738585072014E–308 to 1.7976931348623157E+308. The decimal point and minus sign are ignored when determining thenumber’s total size.DOUBLE([M,D]) [UNSIGNED] [ZEROFILL]The DOUBLE data type is a double-precision floating-point number, supporting a signed range of –1.7976931348623157E+308 to –2.2250738585072014E–308 and an unsigned range of 2.2250738585072014E–308 to 1.7976931348623157E+308.FLOAT([M,D]) [UNSIGNED] [ZEROFILL]This FLOAT data type variation is <strong>MySQL</strong>’s single-precision floating-point number representation,supporting a signed range of –3.402823466E+38 to –1.175494351E–38 and an unsigned range of1.175494351E–38 to 3.402823466E+38.FLOAT (precision) [UNSIGNED] [ZEROFILL]This FLOAT data type variant is provided for ODBC compatibility. The degree of precision can rangebetween 1 to 24 for single precision and 25 to 53 for double precision. The range is the same as thatdefined in the preceding FLOAT definition.String Data TypesMany types are available for representing string data.[NATIONAL] CHAR(Length) [BINARY | ASCII | UNICODE]The CHAR data type offers <strong>MySQL</strong>’s fixed-length string representation, supporting a maximum length of255 characters. If an inserted string does not occupy all of the Length spaces, the remaining space will bepadded by blank spaces. When retrieved, these blank spaces are omitted. If Length is one character, theuser can omit the length reference, simply using CHAR. You can also specify a zero-length CHAR inconjunction with the NOT NULL attribute, which will allow only NULL or "". The NATIONAL attribute isavailable for compatibility reasons because that is how SQL-99 specifies that the default character setshould be used for the column, which <strong>MySQL</strong> already does by default. Supplying the BINARY attributecauses the values in this column to be sorted in case-sensitive fashion; omitting it causes them to besorted in case-insensitive fashion.If Length is greater than 255, the column will automatically be converted to the smallest TEXT typecapable of storing values designated by the provided length. Also starting with version 4.1.0, includingthe ASCII attribute will result in the application of the Latin1 character set to the column. Finally,beginning with version 4.1.1, including the UNICODE attribute will result in the application of the ucs2character set to the column.541

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!