Database Doctor Default Search Form and Search Results

When you saved the Column Names for your database the first time, the program created the HTML for the Search Form and Search Results automatically. After that, when you make changes to the column settings in Database Setup you have the option of having the program rewrite this HTML again.

The public will search your database with the display.cgi script. You will find a link to this in your manager header.

The default search form includes a text search area, a flag to search by any or all, and a list of columns that the viewer can use to limit their search. The columns included in this list have been checked in the Database Setup.

The results from a search are displayed by default in a table with column headings, and one record per row. To include a column in the search results, it must have been checked in the Database Setup.

The Number of Search Results Returned setting will determine how many results are printed to each page. If more results exist, page links are displayed.

Database Doctor Manual
The Database Doctor Manual is designed to help you get the most out of the program. If you would like something discussed here, please post it to the Database Doctor Forum

Example Setups
We have several examples of different types of uses of the Database Doctor Pro. These examples will also show you different ways to configure search links to accomplish anything that might be needed.

Baseball Card Example
Comic Book Example
Directory Example
 

 
Customizing the Result Display

The search results table consists of 3 parts. Each of these parts are a template which can be edited, and when put together create a complete table.

    Search Results Header
  • The header opens the table, and contains the column headings. This template will end with the </tr> HTML tag.
  • Search Results Item

  • The item template is used for each record being displayed. Generally the HTML will begin with <tr> and end with the </tr> HTML tags.
  • Search Results Footer

  • The footer template is used to close out the table with the </table> HTML tags.

Inserting the Data into the Search Result Templates

A replacement system is used to replace the data for a specific column with a tag set in the template. This tag is created by adding the word FIELD (all in caps) to a number assigned to each column relative to its order in the list (1,2,3...beginning with 1) An example would then be: FIELD1, FIELD2, etc..

The program will replace the tag with the data when a match is found. You will find a list of tags and what column they will display above the template edit area in the Display HTML Settings section of your manager.

You may place HTML around your tags as needed. An example where FIELD3 contained an email address and FIELD4 was a name:

Customizing the Search

Any form may also be constructed into a link as well. You will find examples of how to construct a basic link to a specific column above the template edit area in the Display HTML Settings section of your manager.

A perfect use for something like this would be to treat a specific column as a category, and organize your navigation like that. See www.strictlymint.com/links. This may be a Link Doctor implementation, but the principle is the same.

Available Fields for Creating Custom Search Forms and Links

  • search: Required in all links. search=1 tells the program what to do.
  • display_all: dispay_all=1 will display the entire database.
  • column: You will a list of column names above the template edit area in the Display HTML Settings section of your manager.
  • searchtext: searchtext=something will do a keyword search.
  • searchtype: with any or all. searchtype=all means all all keywords must be ptresent.
  • searchterms: See below.

    Examples:
  • display.cgi?search=1&display_all=1 will return the entire database.
  • display.cgi?search=1&column=Description&searchtext=blue would search for the word blue, only in the column named Description.

When constructing your links, notice that everything starts after the script name with a ? and each set is separated by an &. Any of these can be hidden fields in a regular form as well.

Custom Searching using Searchterms:

Searchterms are a way to add a custom search with multiple parameters. Basically this allows the viewer to ask more than one question at a time. We can help them by making drop down lists of information that we know exists in the database. In the example provided below, We are telling you that you can search by Year or Player. We have given you lists that we know exist.

Using Searchterms, every selected parameter must exist for the result to be returned.

Choose any combination of search terms to search.

Here is the HTML for the form from the above search:
<form method=post action="http://www.gletech.com/testarea/dbdoctor/display.cgi" target="_blank">
<SELECT NAME = "Year">
<OPTION>1974</option>
<OPTION>1976</option>
</select>
<SELECT NAME = "Player">
<OPTION>Gaylord Perry</option>
<OPTION>Jim Kaat</option>
</select>
<input type=hidden name="search" value="1">
<input type=hidden name="searchterms" value="Year,Player">
<input type=submit value="Search">
</form>

To create your own searchterm list, create the fields that you want to be in your seach form. Name them whatever you like (without spaces though). These fields can be any type of HTML -- drop downs, text input, checkboxes, radio buttons.

Then create a hidden field named searchterms and put all the names of the fields you created in the value, separated by commas.