Viewing a Database


Once you make a connection to a database in Dreamweaver, that database is available as a source of dynamic content. However, before you add dynamic content to pages, you may want to review what content is available in a specific database. You can use the Databases panel to view the structure of each database table, including the field names and data types, as well as the current table data.

To view a database in Dreamweaver:

1.

Open a new PHP page in Dreamweaver by choosing File > New > Dynamic page > PHP. Save the page as dynamictext.php.

2.

In the Application panel group, click the Databases tab to view the Databases panel. A list of database connections displays in the panel (Figure 7.1).

Figure 7.1. A list of available database connections displays in the Databases panel when you open a dynamic page in Dreamweaver.


For the purposes of this task, we'll use the sample cafetownsend database included with Dreamweaver, which we've used in previous chapters. If you have not made a connection to the cafetownsend database, see Chapter 5 for more information on using Dreamweaver's sample SQL database.

3.

Click the plus (+) button to the left of the connection name to expand the database contents.

4.

Click the plus button to the left of the Tables entry.

A list of table names displays (Figure 7.2).

Figure 7.2. Expand a database name to view a list of table names.


5.

Click the plus button to the left of any table name.

A list displays with the name and data type of each field in that table (Figure 7.3). The primary key field is indicated with a key icon.

Figure 7.3. Expand a database table name to view a list of field names and data types. The primary key field is indicated by a key icon.


6.

Right-click a table name, and from the contextual menu that appears, choose View Data to view the current table data (Figure 7.4).

Figure 7.4. You can view the current data in any database table if a connection to the database has been created in Dreamweaver.





Macromedia Dreamweaver 8 Advanced for Windows and Macintosh. Visual Quickpro Guide
Macromedia Dreamweaver 8 Advanced for Windows and Macintosh: Visual QuickPro Guide
ISBN: 0321384024
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Lucinda Dykes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net