Book Image

Mastering phpMyAdmin 2.11 for Effective MySQL Management

Book Image

Mastering phpMyAdmin 2.11 for Effective MySQL Management

Overview of this book

Table of Contents (25 chapters)
Mastering phpMyAdmin 2.11 for Effective MySQL Management
Credits
About the Author
About the Reviewers
Preface

BLOB (Binary Large Object) Fields


BLOB fields are usually used to hold binary data (such as images and sounds), even though the MySQL documentation implies that TEXT fields could be used for this purpose. The MySQL 5.1 manual says "In some cases, it may be desirable to store binary data such as media files in BLOB or TEXT columns" but another phrase, "BLOB columns are treated as binary strings (byte strings)" seems to indicate that binary data should really be stored in BLOB fields. Thus, phpMyAdmin's intention is to work with BLOB fields to hold all binary data.

We will see in Chapter 16, MIME-Based Transformations that there are special mechanisms available to go further with BLOB fields, including being able to view some images directly from within phpMyAdmin.

First we add a BLOB field, cover_photo, to our book table:

If we now browse the table, we can see the field length information, [BLOB - 0 B], for each BLOB field:

This is because the $cfg['ShowBlob'] configuration directive is...