Prev | Current Page 180 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


For a default query to appear in this box, we can set it with the $cfg['DefaultQu
eryDatabase'] configuration directive, which is empty by default. We could put
a query like SHOW TABLES FROM %d in this directive. The %d parameter in this query
would be replaced by the current database name, resulting in SHOW TABLES FROM
'marc_book' in the query box.
The Table View
A slightly different box is available in the Table view from the SQL menu.
The lower part has bookmark-related choices (explained in Chapter 14). There is
also a Fields selector and an Insert button on the right. The box already has a
default query.
This query SELECT * FROM `book` WHERE 1 is generated from the $cfg['DefaultQue
ryTable'] configuration directive, which contains SELECT * FROM %t WHERE 1. Here,
the %t is replaced by the current table name. Another placeholder available in $cfg
['DefaultQueryTable'] is %f, which would be replaced by the complete field list
of this table, thus producing the query: SELECT `isbn`, `title`, `page_count`,
`author_id`, `language`, `description`, `cover_photo`, `genre`,
`date_published`, `stamp`, `some_bits` FROM 'book' WHERE 1.
WHERE 1 is a condition that is always true, so the query can be executed as is. We can
replace 1 with the condition we want, or we can type a completely different query.
Chapter 12
[ 197 ]
The Fields Selector
The Fields selector is a way to speed up query generation.


Pages:
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192