ASP Database Update

[Total: 0    Average: 0/5]

Updating a Record in Your Database

Updating a record in your database is not very difficult. So let’s just dive right in. First thing we need to do is figure out which record we want to update. We will be using the same database that we’ve been using. First we create a page that will list our users in our users table. Save this page as users.asp.

Now we create our edit.asp page. This page will be a form that pulls the current info about the person from the database.

Finally, we create our updateuser.asp page. First we need to request the ID from the previous page, so we know which record needs updating.

Notice that our UPDATE statement is a bit different than our INSERT INTO statement. First we specify what table we are updating and then tell it to SET the fields equal to the values of our variables. Each field=variable is separated by a comma. Then it ends with the WHERE portion of the string telling it which record needs updating. And there you have it. Now you can edit and update your own records too. See ya next time!

~Geoff Swartz

Times Viewed: 6

Leave a Reply

Your email address will not be published. Required fields are marked *