Join Candyce Mairs for an in-depth discussion in this video Creating an update area, part of Getting Started with ColdFusion 10.
In addition to being able to display tours information, from our travel adventurous database, what we want to allow admin users to do. Or what Travel Adventures as a company wants to allow their employees to be able to do is take tour information and modify it. And I have created this Tours Listing page. What this is, is a listing of all the tours in the database in this point in time.
Now, there are two new tours I just recently inserted. The Oz Adventure is one of them, and the Wineries of Argentina. So, these two titles are new tours that I added. And what this page does is just display these tours within a table structure. But I've added an additional column on the right-hand side. And what this additional column does is allow administrators to click the Edit button for the specific tour they want to be able to update.
And the next page will be the Tours Update form. And that form will pull in the information for that specific tour. So in other words, they click on a tour to edit. This page here is going to show them the information for that specific tour, and allow them to update that information. I do have a completed version of this particular Tours Update page, and I will go out to that Tours Update Complete to show you what I'm talking about. So, here's an example.
This is the form, ultimately this form is showing the Austrian Majesty tour. But you can see how when I open this page, there's some information included within each of these form fields. What occurred to put this information within this area is we queried the database for this specific tours information. And then, we populated each one of the fields within the form with that new database information. So, that's where we're heading with this area.
The Tours Listing will list all of the tours in alphabetical order. Next to each tour is an Edit button. When you click on that Edit button, what that will do is take you over to the Tours Update page. This is the completed version. You can see that I do have the links set up to work with this page. So we're going to build the form, populate those fields, just like this page does.
So, we begin this process by taking our Tours Update page, creating that form down below. And then, we will need to add the SQL to populate the form, just as this form is set up. And when we populate the form, this form will need the Tour ID passed into it in order to query the database for just that specific tours information. So, there are a few steps to an update feature.
There are more steps than just an insert of new data into the database. So, that is the process of creating an update for database data. And we'll be building one for the Travel Adventures website so that admins can come in here and make changes to database data very easily using a ColdFusion form.
- Understanding static vs. dynamic requests
- Using the ColdFusion Administrator
- Creating, displaying, and scoping variables
- Working with include files
- Pulling data from a database
- Displaying and modifying database data
- Passing data between pages
- Working with form data
- Populating form fields with query data