Database Reference
In-Depth Information
This box is simple—we type in some valid (hopefully) MySQL statement and click
Go
. Under the query text area, there are bookmark-related choices (explained later in
Chapter 14). Usually, we don't have to change the standard SQL delimiter, which is a
semicolon. However, there is a
Delimiter
dialog in case we need it (see chapter 17).
For a default query to appear in this box, we can set it with the
$cfg['DefaultQueryDatabase']
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.
There is a
Fields
selector and an
Insert
button (
<<
) on the right. The box already has
a default query as seen in the previous screenshot.
This default query is generated from the
$cfg['DefaultQueryTable']
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
. This placeholder would be replaced by the
complete field list of this table, thus producing the following query:
SELECT `isbn`, `title`, `page_count`, `author_id`, `language`,
`description`, `cover_photo`, `genre`, `date_published`, `stamp`,
`some_bits` FROM 'book' WHERE 1.
Search WWH ::
Custom Search