Locating Records in the Admin with an Advanced Search

Introduction

The search screen of the database administration interface allows you to search for data in specific fields and order results. You may use an advanced string search in the administration interface by adding the advancedSearch parameter to the mgiEditDatabase tag.

MGI Tags

Steps

  1. Create a database administration page in a text editor.
  2. Insert the mgiEditDatabase tag and advancedSearch parameter.
  3. Save the database administration page.
  4. FTP the database administration page to the web server running MGI.
  5. View the database administration page in a web browser.
  6. Select a database.
  7. Enter an advanced search.


Step 1: Create a database administration page in a text editor.

Create a new page in a text editing program to display the web-based, database administration interface.

Step 2: Insert the mgiEditDatabase tag and advancedSearch parameter.

On the database administration page, enter the mgiEditDatabase tag and set the advancedSearch parameter to "On".
<mgiEditDatabase advancedSearch="On">

Step 3: Save the database administration page.

Save the database administration page and name it "dbadmin.mgi".

Step 4: FTP the database administration page to the web server running MGI.

Upload the database administration page (dbadmin.mgi) from your local computer to the web server using an FTP program.

Step 5: View the database administration page in a web browser.

View the database administration page (dbadmin.mgi) in a browser. The first screen of the web-based, administration interface is displayed.

Step 6: Select a database.

Below "Select a database", click the radio button beside the database you wish to search and click the "Records" button. The search screen of the record administration interface displays.

Step 7: Enter an advanced search.

In the search screen of the record administration interface, a blank field appears at the bottom of the field list. To perform advanced searches, select the radio button beside this field and enter advanced search strings, then click the "Search Now" button to view search results.
 
Advanced search strings should contain field name and search criteria in the format keyFieldName='criteria'. Valid operators are "=" (equals), ">" (greater than), "<" (less than), ">=" (greater than and equal to), and "<=" (less than and equal to). Field name and search criteria pairs should be separated by the search operator "AND", "OR", or "NOT". To order the results from a search string, include the order by field in the format ORDER BY keyFieldName. By default, search results are in asending order (ASC). To reverse the order of results in a search string, specify descending order by including DESC after the ORDER BY field. You may not enter quotes ("") in the value of the search string parameter. The following are example search strings:
searchString="LastName='J*' OR LastName='L' 
AND Registration='Yes' ORDER BY CustID DESC"

searchString="FirstName='Ken' AND NOT LastName='Barker'


Comments and Notes

The mgiEditDatabase tag gives you and anyone who views the page in a web browser access to modify databases. Keep your databases secure by password-protecting the database administration page with an mgiAuthenticate or mgiAuthenticateDB tag.


[Return to the Creating and Populating Databases Menu]


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]