Database Reference
In-Depth Information
Hexadecimal representation
Characters are stored in MySQL (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. I remember a case that
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, this transformation will be applied to the title ield
of our book table. When browsing the row containing the Future souvenirs title,
we can see:
As we know which character set this column is encoded with, 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
The term pretty printing ( http://en.wikipedia.org/wiki/Pretty_printing )
refers to a way of "beautifying" source code. 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 the table is browsed.
IP address
An IP (v4) address can be encoded into a long integer (for example, via the PHP
iptolong() function), and stored into a MySQL UNSIGNED INT column. To convert
it back to the familiar dotted string (for example, 127.0.0.1 ), you can use the
text/plain: longToIpv4 transformation.
External applications
The transformations that have been described previously are implemented directly
from within phpMyAdmin. However, some transformations are better executed via
existing external applications.
 
Search WWH ::




Custom Search