Prev | Current Page 200 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"

We first enter the following query:
SELECT author.name, author.id, book.title
FROM book, author
WHERE book.author_id = author.id
/* AND author.name LIKE '%[VARIABLE]%' */
The part between the comments characters (/* */) will be expanded later, and the
tags removed:
We label it and click Go. The first execution of the query just stores the bookmark.
In this example, we have two conditions in the WHERE clause, of which one contains
the special syntax. If our only criterion in the WHERE clause needed a parameter, we
could use a syntax like WHERE 1 /* and author_id = [VARIABLE] */.
Bookmarks
[ 226 ]
Passing a Parameter Value to a Bookmark
To test the bookmark, we recall it as usual and enter a value in the Variable field:
When we click Go, we see the expanded query and author Smith's books:
Executing Bookmarks by Browsing the
pma_bookmark Table
This feature is only available to users who can directly see the pma_bookmark table.
This is the default name given when the linked-tables infrastructure is installed.
In a multi-user installation, this table is usually located in a database invisible to
unprivileged users. Browsing this table displays a new Execute bookmarked query
button, which triggers the execution of the query:
Chapter 14
[ 227 ]
Seeing the text of the query while browsing this table is possible if $cfg['ShowBlob']
is set to TRUE.


Pages:
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212