Paginating the results in Drupal is incredible incredible easy. You just have to remember the two "magic functions":
- pager_query($sql, $count);
- theme('pager',10);
pager_query substitutes the typical db_query. Just something like that:
- // $resource = db_query($sql); // -> old sentence without pager
- $resource = pager_query($sql, $count); // -> pager
Then, we simple come back to the function that is called by our hook_menu, and we change: