Prev | Current Page 220 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


Of course, we choose text/plain: external in the transformations menu.
As the first option, we place the application number. (For example, 0 would be for
the tidy application.) The second option holds the parameters we need to pass to this
application. If we want phpMyAdmin to apply the htmlspecialchars() function to
the results, we put 1 as the third parameter. (This is done by default.) We could put a
0 there to avoid protecting the output with htmlspecialchars().
If we want to avoid reformatting the cell's lines, we put 1 as the fourth parameter.
This will use the NOWRAP modifier, and is done by default.
External Application Example: In-Cell Sort
This example shows how we can sort the text contents of one cell. We start by
modifying the text_plain__external.inc.php script, as mentioned in the above
section, to add the sort program:
$allowed_programs[0] = '/bin/sort';
Note that our new program bears the index number 0.
Then we add a TEXT field, keywords, to our book table and fill in the
MIME-related information, entering '0','-r' as the transformation options:
The '0' here, refers to the index number for sort, and the '-r' is a parameter for sort,
which makes the program sort in reverse order.
Next, we Edit the row for the book A hundred years of cinema (volume 1), entering
some keywords in no particular order and hitting Go to save:
Chapter 16
[ 251 ]
To test the effects of the external program, we browse our table and see the sorted
in-cell keywords:
Indeed, the keywords are displayed in reverse sorted order in this cell.


Pages:
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232