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' => 'Achievement List',
'description' => 'A list of all of my achievements',
'page callback' => 'achievementList_generate_table',
'access arguments' => 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' => $header), array('rows' => $rows) );
}
The headers render fine but the $rows array does not. Any idea why?
theme()
and this