Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Updating the database data


From:

Dynamic Dreamweaver Websites: Creating Login Areas

with Candyce Mairs

Video: Updating the database data

Our Administrative Area for updating a user and that user's information is almost complete. At this point, we have our Admin User List. This is a listing of all of the users or members inside our website. You can see some of those members are missing some information. But we have our table printing out all of our members. We also have the User ID for each member as a hyperlink.
Expand all | Collapse all
  1. 1m 32s
    1. Welcome
      1m 32s
  2. 2m 57s
    1. Course overview
      1m 16s
    2. The course environment
      1m 41s
  3. 26m 58s
    1. Static vs. dynamic requests
      4m 8s
    2. Installing XAMPP on a Windows system
      8m 54s
    3. Installing MAMP on a Mac system
      4m 29s
    4. Using admin consoles
      3m 54s
    5. Installing the course files
      5m 33s
  4. 18m 36s
    1. Overview of the Dreamweaver interface
      6m 22s
    2. Setting up the course site
      6m 20s
    3. Previewing pages
      5m 54s
  5. 33m 38s
    1. Creating PHP pages
      5m 45s
    2. Adding PHP code
      5m 44s
    3. Displaying variables
      4m 45s
    4. Commenting your code
      5m 30s
    5. Working with includes
      5m 58s
    6. Building the course templates
      5m 56s
  6. 35m 13s
    1. What is a database?
      5m 2s
    2. Adding database tables
      7m 34s
    3. Connecting to the database
      8m 28s
    4. Getting data from a database: Part one
      8m 25s
    5. Getting data from a database: Part two
      5m 44s
  7. 1h 16m
    1. Planning the login process
      7m 25s
    2. Creating a login form
      7m 45s
    3. Adding form validation: Part one
      9m 22s
    4. Adding form validation: Part two
      1m 37s
    5. Exploring the registration page
      7m 17s
    6. Correcting table fields
      6m 1s
    7. Setting up the login landing page
      4m 1s
    8. Using server behaviors
      3m 36s
    9. Inserting new members
      8m 48s
    10. User authentication
      10m 3s
    11. Restricting access to pages
      5m 17s
    12. Testing the login
      4m 53s
  8. 1h 6m
    1. Admin area overview
      5m 9s
    2. Adding new users
      5m 19s
    3. Restricting access
      12m 25s
    4. Planning the admin update area
      5m 19s
    5. Building the members table listing
      6m 55s
    6. Building the querystring
      9m 14s
    7. Populating the update form
      6m 33s
    8. Updating the database data
      11m 28s
    9. Testing the admin update process
      3m 47s

please wait ...
Watch the Online Video Course Dynamic Dreamweaver Websites: Creating Login Areas
4h 21m Intermediate Jun 06, 2011

Viewers: in countries Watching now:

An important but little-understood concept in dynamic web development is that of role-based logins, which allow different types of users to access different parts of the site. In this course Adobe Certified Expert Candyce Mairs shows how to use Dreamweaver's features to create role-based logins, restrict page access, build an administrator area, and test everything to make sure it works. Plus, see how to set up a development environment and work with a database from within Dreamweaver. Along the way, build your skills in areas like working with PHP, adding form validation, using server behaviors, and much more.

Topics include:
  • Installing XAMPP on a Windows system
  • Installing MAMP on a Mac system
  • Using admin consoles
  • Previewing pages
  • Working in PHP
  • Adding database tables
  • Getting data from a database
  • Building the login area
  • Planning the admin update area
  • Testing the admin update process
Subjects:
Developer Web video2brain
Software:
Dreamweaver
Author:
Candyce Mairs

Updating the database data

Our Administrative Area for updating a user and that user's information is almost complete. At this point, we have our Admin User List. This is a listing of all of the users or members inside our website. You can see some of those members are missing some information. But we have our table printing out all of our members. We also have the User ID for each member as a hyperlink.

It is passing the query string information. So, if I click a particular member, I'll use John, its passing the User ID to the User Update page. We are using that User ID information to query the database, our login table for that user's information, and we now have that information populating our form. There is one minor issue occurring within our form. And that is our role is actually adding the User ID within this area, not showing their specific role.

The reason is because when we created this information for this menu, it's not quite correct information. Now, I don't like to show you everything working perfectly. I'd like to show you some of these issues that can occur so you'll learn how to go back and modify information as well. So when you're on your own, it makes sense and you know what to do when a problem occurs. So, let's go back out to that particular form, which is this one here, the Admin User Update page.

Let's fix this role menu before we plan the Update button. In our Role Area, if I select that menu and click the Dynamic button, you'll see these are static options, so these are not coming from our database. The information is coming from our record set out of the database, but the values I am using for both this area, the information passed in the form and what the user sees, is being set up based on the User ID.

Which is why we're seeing that number. What I want to do is change this to role. So, I will set these up to populate based on the user's role in the database, not their ID. If I click OK, I'll go back out to the browser. I'll go back to the User List, click John one more time, and this time he's being shown as a guest. And let me Refresh this page just to make sure.

We still have our tour ID showing up in here, so our page has not been refreshed. Notice I have this little asterisk here. That means I haven't saved the new page, so I'll go back to User List Preview, this in the browser. Once again, having to login, click the Login button. Here is John's User ID. I will select that. It's showing him as a guest, and we have gotten rid of our tour ID from this listing.

Now, the reason that this is showing three pieces is this one is coming from the database. These two are static options. They're not in the database. So, I need to make a decision. Do I want ot have the static options listed in additon to his present role, or how do I want to set that up? And I'm just going to leave this as is for now because I should be able to switch to the Admin User and click Update User Details. We will insert him as an Admin User from that point on. So, it's up to you if you want to get rid of these top two static options. If you wanted to, you would go out to the menu on the Update page, click the Dynamic button, and these are the two that you're seeing in addition to a listing of what the present role is.

Now, this form could be set up a little bit different. We could have the role say, Present Role, and only show the database data. And we could put another menu underneath this one saying, Updated Role, and we could allow the admin to chose admin or guest in that second menu. I am doing this all within a single menu. So, as soon as they click on a User ID, it will show to our admin folks what their present role is and it will give them the option to change to either one of these all within the same menu.

It makes it a little bit simpler, our admin can do things a little faster. So, we will have three listings in there. The first one that shows will be what they are in the database right now, and then they can choose which of these additional options they want to change to. I don't think that will be too confusing since we're only having a limited number of admin people working in this form anyway. So, there is our role corrected, listing their present role in the database and giving our admin the choice to switch them to either guest or admin depending upon what their present role is. Now, we need to add the update record piece.

So, I want them to be able to change that data. And when they click this Update User Details button, it's going to change the data in the database to that new information in the form. In order to do that, I need to go out to the Server Behaviors panel. This can be accessed within the Window menu, if it's not open. You can see we have quite a few server behaviors listed. As we've added these dynamic features within Dreamweaver, Dreamweaver has added them here for us so we don't need to be concerned about that.

That is what's creating what we've done so far. What I want to do is add to it, so I'll hit the Plus sign and I'm going to say Update Record. Now, within this interface, we have our form, and I don't have my form named properly. Notice down in the Tag Selector it says Form 1. I could have it say Update Form. I'm not going to be concerned about that right now because it does not affect our functionality at this point.

So, that is the only form we have on this page, so that's why it's populated here. Our connection we want is this Con Login connection, but the table we're going to be working in is the Login Table. And as soon as we choose Login, what Dreamweaver is going to do is try and match up the columns in our database, which is this first listing, with each of the fields within our database. So, it says form dot. These are the form field names.

But notice our User ID is not being used right now. In order to update a single user, we need to tell the database which user we want to update. And our form does not have that information in it presently, which is why our User ID says it's not being used. We need to use that. So, I'm going to Cancel out of this piece. We need a way to add the User ID to this form so the user cannot modify it.

But the Update Record Server Behavior will have access to that information. So, we can send the database which user to update. In order to add that piece, what I'm going to do is add a hidden form field. Now, this can be plugged into anywhere on the form, it does not have to be on the end. I'm just putting it here to make it easy for you to see where this is located. The hidden form field is the third icon. It says Hidden Field on it in the Forms tab of the Insert bar. So, I'm going to click that Hidden Field icon.

It adds a hidden field wherever my cursor is, and that hidden field is going to become our User ID information, telling the database which user to update. So, User ID will be the name of it. Our value is going to come from the database. So, our record set that we created in the Bindings panel has a User ID being pulled out, and this is why we wanted that. So, I'll click Bind to Dynamic Source.

We're going to set our Hidden Form field name to User ID, the value is going to be whatever the User ID is for the user that's shown. I will click OK, and Dreamweaver populated that information for PHP to figure out which User ID it is. Let's go out to Save this. And I need to go back to my Admin User List. So, I will hit the Back button here, and we'll start from the beginning.

User ID is number 3. We now have populated John's information within this area. Also, on this page is a Hidden Form field. If I go into View Page Source, there is a Hidden one right down here, this must be within our Form tag, and the name is User ID. Notice our value is set to 3. That's because John, who is showing in our form, has User ID of 3. So, that's all being done for us.

Now, we can add the Update Record Server Behavior and have access to that User ID. So, I will double-click Update User Details button one more time. We'll go out to our Server Behavior panel, click the Plus sign, say Update Record. You can see this slick a little bit different because it's the country's table, we'll switch that to Login. Now, Dreamweaver understands our User ID is coming from the form User ID Value. After updating, we will send them back to the Admin User List page where they should be able to see the new information inserted into the database. So, that is our Update Record Server Behavior all set up within our Update form.

There are currently no FAQs about Dynamic Dreamweaver Websites: Creating Login Areas.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dynamic Dreamweaver Websites: Creating Login Areas.

Return to your organization's learning portal to continue training, or close this page.


OK

Upgrade to View Courses Offline

login

With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Start your FREE 10-day trial

Begin learning software, business, and creative skills—anytime,
anywhere—with video instruction from recognized industry experts.
lynda.com provides
Unlimited access to over 4,000 courses—more than 100,000 video tutorials
Expert-led instruction
On-the-go learning. Watch from your computer, tablet, or mobile device. Switch back and forth as you choose.
Start Your FREE Trial Now
 

A trusted source for knowledge.

 

We provide training to more than 4 million people, and our members tell us that lynda.com helps them stay ahead of software updates, pick up brand-new skills, switch careers, land promotions, and explore new hobbies. What can we help you do?

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.