O'Reilly logo

PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MySQL

Selecting the proper column type for your tables is key to a successful database. Table B.10 lists the different string, number, and other types you can use, along with how much space they will take up on the server’s hard drive. When choosing a type for each column, you should use the most efficient (i.e., the most size-frugal) data type given what the largest value of the column could be.

Table B.10. The list of available types for column definitions in a MySQL table.
MySQL Data Types
TypeSizeDescription
CHAR[Length]Length bytesA fixed-length field from 0 to 255 characters long
VARCHAR[Length]String length + 1 bytesA variable-length field from 0 to 255 characters long
TINYTEXTString length + 1 bytesA string with a maximum length of 255 characters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required