Performing a complete database search

In the previous examples, searching was limited to one table. This assumes knowledge of the exact table (and columns) where the necessary information might be stored.

When the data is hidden somewhere in the database, or when the same data can be presented in various columns (for example, a title column or a description column), it is easier to use the database search method.

We enter the Search page in the Database view for the marc_book database:

Performing a complete database search

In the Word(s) or value(s) section, we enter what we want to find. The % wildcard character can prove useful here—but remember the performance advice about wildcard characters given earlier in this chapter. We enter souvenirs.

In the Find section, we specify how to treat the values entered. We might need to find at least one of the words entered, all words (in no particular order), or the exact phrase (words in the same order, somewhere in a column). Another choice is to use as regular expression, which is a more complex way of doing pattern matching. More details are available at http://dev.mysql.com/doc/refman/5.1/en/regexp.html and http://www.regular-expressions.info/. We will keep the default value—at least one of the words.

We can choose the tables to restrict the search or select all the tables. As we only have two (small) tables, we select both.

Note

As the search will be done on each row of every table selected, we might hit some time limits if the number of rows or tables is too big. Thus, this feature can be deactivated by setting $cfg['UseDbSearch'] to FALSE. (It is set to TRUE by default).

Clicking on Go finds the following result for us:

Performing a complete database search

This is an overview of the number of matches and the relevant tables. We might get some matches in the tables in which we may not be interested. However, for the matches that look promising, we can click on browse to browse the results page, or we can choose delete to delete the unwanted rows. The show search criteria link would bring back our criteria panel.

Restricting search to a column

Sometimes, a particular column name is part of one (or many) tables, and we want to search only inside this column. For example, suppose that we are looking for "marc"; but this name could be also part of a book's title. So, we want to restrict the search to only the "name" column in all the chosen tables. This can be achieved by entering "name" in the inside column choice.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.4.179