Drupal 7 has brought a lot of changes for developers. One of the biggest changes is Drupal 7's new database API. An object-oriented system implemented developers.

The new database API is built with PHP's native PDO engine. Take a look at the following example:

/* Drupal 6 query */
$sql = "SELECT n.nid, n.title, n.uid FROM {node} n WHERE n.type = 'article'";
$results = db_query_range($sql, 0, 50);

/* Drupal 7 query */
$query = db_select('node', 'n');
$query->condition('n.type', 'article', '=')
      ->fields('n', array('nid', 'title', 'uid'))
      ->range(0, 50);
$result = $query->execute();