Database Reference
In-Depth Information
This report contains information about the server, database, time of generation,
version of phpMyAdmin, version of MySQL, and generated SQL query. The other
link,
Print view (with full texts)
would print the contents of the
TEXT
fields in
their entirety.
Wildcard search
Let's assume we are looking for something less precise—all topics with "cinema" in
their title. First, we go back to the search page. For this type of search, we will use
SQL's
LIKE
operator. This operator accepts wildcard characters—the
%
character
(which matches any number of characters) and the underscore (
_
) character (which
matches a single character). Thus we can use
%cinema%
to let phpMyAdmin
find any substring that matches the word
"cinema"
. If we left out both wildcard
characters, we will get exact matches with only that single word.
This substring matching is easier to access, being part of the
Operator
drop-down
list. We only have to enter the word
cinema
and use the operator
LIKE %...%
to
perform that match. We should avoid using this form of the
LIKE
operator on big
tables (thousands of rows), as MySQL does not use an index for data retrieval in this
case, leading to wait time that could add up to half an hour (or more). This is why
this operator is not the default one in the drop-down list, even though this method of
search is commonly used on smaller tables.
Here is a screenshot showing how we ask for a search on
cinema
with the
operator
LIKE %...%
:
The
LIKE
operator can be used for other types of wildcard searches, for
example
History%
,
which would search for this word at the beginning
of a title. This form of
LIKE
query also has the benefit of using an index, if
MySQL finds one that speeds up data retrieval.
Search WWH ::
Custom Search