Team LiB
Previous Section Next Section

Planning and Creating Your Administrative Menu

You could just write one script that says, "Select all my data; I don't care about the order," but that would be boring. In this chapter, you'll see four ways to select records from the my_music table. To facilitate easy navigation, create an administration menu—fancy words for "a list of links to scripts."

  1. Open a new file in your text editor and type the following HTML:

    <HTML>
    <HEAD>
    <TITLE>My Menu</TITLE>
    </HEAD>
    <BODY>
    <H1>My Menu</H1>
    <P><strong>My Music</strong></P>
    
  2. Start a bulleted list, and create the first link to a script called sel_byid.php. This script will display the records ordered by ID number:

    <ul>
    <li><a href="sel_byid.php">ordered by ID</a>
    
  3. Add a link to a script called sel_bydateacq.php. This script will display the records ordered by date acquired. The most recently acquired item is listed first:

    <li><a href="sel_bydateacq.php">ordered by date acquired</a>
       (most recent first)
    
  4. Add a link to a script called sel_bytitle.php. This script will display the records ordered by title:

    <li><a href="sel_bytitle.php">ordered by title</a>
    
  5. Add a link to a script called sel_byartist.php. This script will display the records ordered by artist:

    <li><a href="sel_byartist.php">ordered by artist</a>
    
    
  6. Close the bulleted list, and then add some HTML so that the document is valid:

    </ul>
    </HTML>
    
  7. Save the file with the name my_menu.html, and place this file in the document root of your web server.

  8. Open your web browser and type http://127.0.0.1/my_menu.html.

    Click To expand

In the next sections, you create the scripts that do all the aforementioned selecting.


Team LiB
Previous Section Next Section