Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Querying the database with db_select()

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:07
    In this chapter, I'm going to show you how to get data out of the database.
  • 0:12
    If you have already downloaded our Demonstration module,
  • 0:16
    you can see that I have created a page at admin/reports/node-list.
  • 0:21
    And we can go ahead and go there now.
  • 0:24
    So on our example site, we're going to click on Reports,
  • 0:28
    and you can see that our List of Nodes page does exist there.
  • 0:34
    So for this example, what we really want to do
  • 0:36
    is show a listing of how many nodes are published and unpublished
  • 0:41
    for each content type.
  • 0:43
    So let's go take a look at our code.

Querying the Database with db_select()


In this chapter we learn how to get data out of the database and display it. The example walks through writing a module that creates a page that displays how many nodes are published and unpublished for each content type in our site. We use the db_select() function to accomplish this.

Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.