Databases Reference
In-Depth Information
Hexadecimal Representation
Characters are stored in MySQL (as in computers in general) as numeric data and
converted into something meaningful for the screen or printer. Users sometimes cut
and paste data from one application to phpMyAdmin, leading to unexpected results
if the characters are not directly supported by MySQL. A case I remember involved
special quotation marks entered in a Microsoft Word document and pasted to
phpMyAdmin. It helps to be able to see the exact hexadecimal codes, and this can be
done by using the application/octetstream: hex transformation.
In the following example, we have applied this transformation to the title field of
our books table. When browsing the row containing the Future souvenirs title, we
now see:
Since we know which character set this column is encoded with (see Chapter 17),
we can compare its contents with a chart describing each character. For instance,
http://en.wikipedia.org/wiki/Latin1 describes the latin1 character set.
SQL Pretty Printing
Let's say we are using a table to store the text of a course about SQL. In one column
we might have put sample SQL statements. With the text/plain: sql transformation,
these SQL statements will be displayed in color with syntax highlighting when
browsing this table.
External Applications
The transformations that have been described previously are implemented directly
from within phpMyAdmin. However, some transformations are better done via
existing external applications.
The text/plain: external transformation enables us to send the cell's data to another
application that will be started on the web server, capture this application's output,
and display it in the cell's position.
This feature is only supported on a Linux or UNIX server (under Microsoft
Windows, output and error redirection cannot be easily captured by the PHP
process). Furthermore, PHP should not be running in safe mode, so the feature might
not be available on hosted servers. A minimum PHP version of 4.3.0 is required for
this feature to work.
 
Search WWH ::




Custom Search