Accessibility

Table of Contents

Creating an event registration application in PHP – Part 1: Building the front end

Getting started

Before you begin building the application, examine the database tables that are employed and also verify that the database connection is properly set up in Dreamweaver.

Note: It's a good idea to have your dynamic PHP site already set up at this point and have unpacked the sample files into the local root folder.

Understanding the database schema

The database that accompanies this article is a relatively simple one with three tables: presentations, registrants, and admin. Only the first two tables come into play during this exercise; the admin table is used in conjunction with a related article that describes how to set up an administrative site for event registration.

The presentations table maintains information for the various sessions held during the event. The presentations table includes data columns for storing the presentation's name, a short description and a longer description (see Figure 1). There are also columns for the date and time of the talk, its duration and the day of the event (1, 2, 3, and so on) on which the presentation is given. Speaker details, such as name and file name for a picture, round out the table schema.

The presentations database schema

Figure 1. The presentations database schema

In comparison, the registrants table has far fewer data columns. Only columns for the registrant's first name, last name, e-mail address, and event name are included. You could—and probably would—require a much more robust set of data columns for an actual application, but this structure should give you a good sense of the type of information you can gather.

The SQL file for the Subscriptions database is included in the sample files download, in the database folder. You can recreate it on your test server through any number of utilities including phpMyAdmin, MySQL Control Center, or MySQL Administrator.

Making the database connection

After you've established your database, it's time to create a connection to it in Dreamweaver. To do so, follow these steps:

  1. Choose Window > Databases.
  2. Click Add (+)  and choose MySQL Connection from the menu.
  3. In the MySQL Connection dialog box appears, do the following (see Figure 2):

    • Enter the name of your new connection in the Connection name field (for example, connEventReg).
    • Enter an IP address or MySQL server name in the MySQL server field. If you're working with a local development system, enter localhost.
    • Insert your user name and password in the appropriate fields.
    • Click Select to display the available databases; choose the one you want from the list.

      The Dreamweaver database connection

      Figure 2. The Dreamweaver database connection

  4. Click Test to verify the connection and then OK if the connection is successful.

With your PHP dynamic site, MySQL database, and Dreamweaver connection all established, you're ready to build the first page of the application.