Chapter 16. Transforming Data using MIME

In this chapter, we will cover a powerful phpMyAdmin feature—its ability to transform a column's contents during a table browse, based on specific rules called transformations. Normally, browsing a table shows only the original data that resides in it. However, MIME-based transformations permit the alteration of the display format.

Note that this kind of transformation does not have the same effect as a permanent data change, such as one made via the UPDATE statement. The transformed data is not written back to the MySQL server; it is just sent to the browser for display purposes.

Browsing data without transformations

Normally, the exact contents of each row are displayed, except that:

  • The TEXT and CHARACTER columns might be truncated, according to $cfg['LimitChars'], and depending on whether we have chosen to see Full Texts or not
  • BLOB and geometry-related columns might be replaced by a message such as [BLOB - 1.5 KB]

We will use the term cell to indicate a specific column of a specific row. The cell containing the cover photograph for the "Future souvenirs" book (a BLOB column) is currently displayed as cryptic data such as ‰PNG  IHDR or as a message stating the BLOB column's size. It would be interesting to see a thumbnail (shown in the following screenshot) of the picture directly in phpMyAdmin and possibly the full-size picture itself. This will be made possible with proper transformation.

Browsing data without transformations

Switching display options

In Browse mode, the Options link reveals a slider that contains, among other choices, a Hide Browser transformation checkbox. We can use it whenever we want to switch between viewing the real data of a cell and its transformed version.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.78.136