PHP and MySQL Web Development - P46

PHP and MySQL Web Development - P46: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Column Data Types 197 Of course you should apply common sense to all this freedom. Just because you can call a database create database it doesn t that mean that you same principle applies as in any other kind of programming use meaningful identifiers. Column Data Types The three basic column types in MySQL are numeric date and time and string. Within each of these categories are a large number of types. We ll summarize them here and go into more detail about the strengths and weaknesses of each in Chapter 11. Each of the three types comes in various storage choosing a column type the principle is generally to choose the smallest type that your data will fit into. For many data types when you are creating a column of that type you can specify the maximum display length. This is shown in the following tables of data types as M. If it s optional for that type it is shown in square brackets. The maximum value you can specify for M is 255. Optional values throughout these descriptions are shown in square brackets. Numeric Types The numeric types are either integers or floating point numbers. For the floating point numbers you can specify the number of digits after the decimal is shown in this book as maximum value you can specify for D is 30 or M-2 that is the maximum display length minus two one character for a decimal point and one for the integral part of the number whichever is lower. For integer types you can also specify if you want them to be UNSIGNED as shown in Listing . For all numeric types you can also specify the ZEROFILL values from a ZEROFILL column are displayed they will be padded with leading zeroes. If you specify a column as ZEROFILL it will automatically also be UNSIGNED. The integral types are shown in Table . Note that the ranges shown in this table show the signed range on one line and the unsigned range on the next. Table Integral Data Types Type Range Storage bytes Description .

Không thể tạo bản xem trước, hãy bấm tải xuống
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.