Prev | Current Page 234 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"

For example, a
click on Drop would produce:
Do you really want to: DROP VIEW 'book_author'
At this point, we can confirm (or not) this view's deletion.
To perform actions on views, a user needs to have the appropriate
privilege at the view level, but not necessarily any privilege on the
tables involved in this view. This is how we can achieve column and
table hiding.
Creating a View from Results
Creating a complex view might require typing the complete statement into a query
box. Another possibility is to take advantage of phpMyAdmin's Search (at the table
level) or Query (at the database level) features to build a rather complex query,
execute it, and then easily create a view from the results. We'll see how it is done.
We mentioned that a view can be used to limit the visibility of columns (and in fact, of
tables). Let's say that the number of pages in a book is highly classified information.
We open the book table, click Search, and choose a subset of the columns:
Chapter 18
[ 269 ]
Clicking Go produces a results page, on which we see a CREATE VIEW link:
We use this link to bring the view creation panel, which already has the underlying
query in the AS box. We need to choose a name for this view (here book_public_
info) and we can optionally set different column names for it (here number, title).
The other options can influence the view's behavior and are explained in the MySQL behavior and are explained in the MySQL
manual (http://dev.


Pages:
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246