Why won't my module table populate I have a page that is supposed to output a table of values from my database. I am logged in as an admin and another page I created works just fine, outputting a form for data to be entered into the database. I have the following lines of code pertaining to the new page..

function achievementList_menu() {
$items = array();   
$items['achievementList/list'] = array(
    'title' =&gt; 'Achievement List',
    'description' =&gt; 'A list of all of my achievements',
    'page callback' =&gt; 'achievementList_generate_table',
    'access arguments' =&gt; array('access content'),
);
return $items;
}


and

EDIT:

function achievementList_generate_table() {
$header = array('ID', 'Name', 'Description', 'Points');
$rows = array();
$results = db_query("SELECT * FROM {achievements}");

foreach ($results as $row){
    $rows[] = $row;
}

return theme('table', array('header' =&gt; $header), array('rows' =&gt; $rows) );
}


The headers render fine but the $rows array does not. Any idea why?
I can see a few problems at first glance:

'access callback' =&gt; TRUE, will mean everyone gets access no matter what and make 'access arguments' redundant.

The default access callback is user_access, which would accept your access arguments of array('access content'). So to use that just omit the access callback line.

$items['achievementList/list'] = array( is a strange path.
Generally best to keep it all lower case but that's not a requirement.

'page arguments' =&gt; array(1), will be passing in the string "list" to your achievementList_generate_table() function, but there is no point passing in a parameter that never changes and you arent actually using it, so just array() is fine for those arguments.

For more information I recommend reading all of the documentation for hook_menu().

The real problem though would be that your callback function is not returning anything for some reason.

(as per Clive's comment) I'm going to assume you are using Drupal 7.
In which case your call to the theme() function is incorrect.

In drupal 7 all variables going into the theme function should be in an array, so your line should look like this:

return theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));