Prev | Current Page 199 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


The users' ability to see meaningful results from the bookmark depends on
the privileges they have on the tables referenced in the bookmark.
The users will be able to delete the bookmark.
The Default Initial Query for a Table
In the previous examples, we chose bookmark labels according to our preferences,
but by convention, if a bookmark has the same name as a table, it will be executed
when Browse is clicked for this table. Thus, instead of seeing the normal Browse
results of this table, we'll see the bookmark's results.
Suppose we are interested in viewing (by default, in the Browse mode) the books
with a page count lower than 300. We first generate the appropriate query, which
can be done easily from the Search page, and then we use book as a label on the
results page:
??? ??? ???
Chapter 14
[ 225 ]
Bookmark Parameters
If we look again at the first bookmark we created (finding all books for author 1), we
realize that, although useful, it was limited to always finding the same author.
A special query syntax enables the passing of parameters to bookmarks. This syntax
uses the fact that SQL comments enclosed within /* and */ are ignored by MySQL.
If the /*[VARIABLE]*/ construct exists somewhere in the query, it will be expanded
at execution time with the value provided when recalling the bookmark.
Creating a Parameterized Bookmark
Let's say we want to find all books for a given author when we don't know the
author's name.


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