Creating a Drupal Block Programmatically and Basic MySQL Usage

  • James Barnett


This chapter shows how you can have a Drupal module do more than one thing—in this case the hello_world module creates a custom page and you will now create a custom block. Rather than create a brand-new module to create the custom block, you’ll just add code to the existing module. This chapter also explores how to construct basic queries to pull information out of Drupal’s back-end datastore, which for most Drupal installations will be a MySQL database (although hooking up other database types to Drupal is possible).


Content Type User Table Simple Block Basic Query Node Table 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© James Barnett 2015

Authors and Affiliations

  • James Barnett
    • 1
  1. 1.MAUS

Personalised recommendations