My pager code doesn't work
Your code is using the string concatenation operator with an array; you need the assignment operator.

$rows[] = array($record-&gt;nid, $record-&gt;title);




$headers = array(t('node'), t('Title'));
$rows = array();

$nodes = db_select('node', 'n')
  -&gt;fields('n', array('nid', 'title'))
  -&gt;extend('PagerDefault')
  -&gt;limit(5)
  -&gt;execute();

foreach ($nodes as $node) {
  $rows[] = array($node-&gt;nid, $node-&gt;title);
}

return theme('table', $headers, $rows) . theme('pager');


Depending from which function contains that code, it could also be re-written as follows:

$page = array();
$rows = array();

$nodes = db_select('node', 'n')
  -&gt;fields('n', array('nid', 'title'))
  -&gt;extend('PagerDefault')
  -&gt;limit(5)
  -&gt;execute();

foreach ($nodes as $node) {
  $rows[] = array($node-&gt;nid, $node-&gt;title);
}

$page['table'] = array(
  '#rows' =&gt; $rows, 
  '#header' =&gt; array(t('Node'), t('Title')), 
  '#theme' =&gt; 'table', 
  '#empty' =&gt; t('No content available.'), 
);

$page['pager'] = array(
  '#theme' =&gt; 'pager', 
);

return $page;