Drupal 7 Module Development Tutorial #4 - Inserting Data Into and Deleting Data From Our Database

In this 4th video tutorial on Drupal 7 module development, I show you how we can insert data into and delete data from our database. To do so, we first call the hook hook_flag_flag from the flag module and use the Devel module to look inside the variables passed to the function. From there, we are able to grab the data we need and using the database api, insert our data into the database. 

Following similar steps, we conclude the tutorial by deleting the data from the database when a node is unflagged.