Adding Database Records

Example

Adding product information to a database for a searchable, database-driven, shopping basket.

MGI Tags

  • mgiEditDatabase

Steps

  1. Create a database record administration page in a text editor.
  2. Insert the mgiEditDatabase tag.
  3. Save the database record administration page.
  4. FTP the database record administration page to the web server running MGI.
  5. View the database record administration page in a browser.
  6. Add a database record for each product.


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

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

Step 2: Insert the mgiEditDatabase tag.

On the database record administration page, enter the mgiEditDatabase tag, databaseFileLocation parameter, tableName, and modifyRecords parameter. In the databaseFileLocation parameter, enter the name of the database file where records will be added. In the tableName parameter, enter the name of the database table where records will be added. In the modifyRecords parameter, enter "Yes".
<mgiEditDatabase databaseFileLocation="Clothing" tableName="Tshirts" 
modifyRecords="Yes">

Step 3: Save the database record administration page.

Save the database record administration page and name it "adminr.html".

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

Upload the database record administration page from your local computer to the web server using an FTP program.

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

View the database record administration page (adminr.html) in a browser. The record search page of the web-based administration interface is displayed.

Step 6: Add a database record for each product.

To add a new database record (i.e., information for one product in the database), click the "Add Record" button on the "Record Search" screen. A blank record containing a label and field type for each database field is displayed. Enter information for the first product in the blank database fields (Note: if the product will be used with a database-driven shopping basket system, you must at least enter information for the product ID, brief description, price and shipping). Pay attention to the field type when you enter information. For example, enter only numbers and a decimal in a floating point field. In order to add a record, you do not have to enter information into every field.
 
When all information is entered into the database fields, click the "Submit Record" button on the Add Record screen to save the record to the database table and file. Upon submission, the Record Added screen displays the field name and values that were entered for the record. To add the next record, click the "Add Record" button on the Record Added screen.
 
Using the instructions in this step, add a record for each product that you wish to display in the searchable, database-driven, shopping basket.
 
To create the search and results pages of the database, read the instructions for Searching Databases. To integrate a shopping basket into the searchable database, read the instructions for Shopping Online.

[Return to the Populating Databases Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]