Introduction

Review an introduction to this chapter.

We'll cover the following

So far we’ve worked on creating or inserting data into the database and reading or selecting it. We still have things to do in order to completely finish with the implementation of our CRUD database application, such as updating, editing, or deleting features.

In this chapter, we’ll learn how to overwrite a record in the database and completely remove it from the database.

Update records

Once a record is inserted in the database, we want to give the possibility to our users to modify the record if needed.

The user will have to send the id of the record they want to edit and specify which id will be used in the backend to update the record with the UPDATE SQL statement. To make it easier for the user to pass the record id, we’ll refactor the list of records (tasks or projects) in such a way that they are clickable.

Delete a record

Sometimes editing a record is not enough —we may need to remove it completely and re-enter a new record. That’s where the last letter of our acronym, D, comes from.

The main keyword here is DELETE.

We will add a “Delete” button from the list of records that we’ll handle in the controller.

Get hands-on with 1000+ tech skills courses.