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

preview_player
Показать описание


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.
Рекомендации по теме
Комментарии
Автор

Learned more in one video than in 4 videos from one of the expensive sites. Way to Go!!

jeffreyjones
Автор

This tutorial was a huge help. Your tutorials are always helpful and easy to understand. Thank you. God bless you.

garettechristie
Автор

Thank you for the resource. Your tutorials are very thorough and clear. Greatly Appreciated.

andrewbickford
Автор

This tutorial is very useful, helpful and thankful!
Thanks.

kim_jungil
Автор

Thanks Pete for filling in some holes for me

jeffguroo
Автор

Hi. Awesome tutorial series (your D7 Module Dev series).

gp
Автор

hi at 3:49 you seemed to have application going but where did you define this application in order to see the dsm

Mosheinventions
Автор

Thanks for the nice tutorial. Incase if I can ask, Is there a way to look or download the code to test it on my local?

nadirh
Автор

I really have been enjoying the series... I'll need to go by and buy one or two out of good faith.... especially if i'm able to raise my hands in the air and shout "success" lol . Seriously this is the closest I've come to getting my head around what a hook is and hope I'll feel empowered by #10

  I wasted about 4 hours because I spelled execute as excecute ... couldn't see it for the life of me.  

I was looking for a different error, using my vps they use a naming convention with each table having a 'drupal" in front of it like "drupal_flag_application".. which i thought was the heart of my error...but it wasn't.  Somehow something on the server picked it up if I just named everything flag_application.. HOWEVER,  if i wanted to go check the table using myadmin I had to look at a table drupal_flag_application nothing appeared in the flag_application I created. tldr keep the names the same as the tutorial,  look for a different name to review your work, and spell execute correctly.

TomsTomTomdotcom
Автор

When you created the table, can't you utilize mysql foreign key to link up flagging_id with the main table? This way, you don't have to write the unflag function?


becauseoffreedom
visit shbcf.ru