Tutorial: Displaying Database Info

In this tutorial, you’ll continue the work you started on the CosmoFarmer website in the last chapter. Displaying the products available from CosmoFarmer’s online store requires two dynamic pages. The first one displays a list of all the products available on the site. From that page, visitors can jump to a detailed description of an item for sale by clicking its name. You’ll learn how to create both basic and advanced recordsets, and take advantage of some of Dreamweaver’s built-in application objects.

This tutorial assumes you’ve done all the setup work described in Chapter 23. If you haven’t, turn to Setting Up a Testing Server and follow the instructions to prepare the application server, database, and Dreamweaver for this project. (Also make sure you have WAMP or MAMP up and running, as described on pages Setting Up a Testing Server and Macs.)

Creating a Recordset

You’ll start by opening an existing page and adding a recordset to it:

  1. In the root folder of the local site you defined in the previous chapter, open index.php.

    Either choose File→Open and navigate to and select index.php, or, in the Files panel, double-click the file name.

    The basic structure of this page is already complete. It was built using CSS layout, the Spry Navigation Bar, a table, Cascading Style Sheets, and the other HTML features you’ve already learned. Nothing about this page is dynamic yet, so you’ll need to create a recordset and insert database information into the page. ...

Get Dreamweaver CS5: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.