I am simply trying to return the rows from a table in my db but i keep getting this error thrown back at me no matter what I do "Fatal error: Unsupported operand types in C:\xampp\htdocs\d7\includes\form.inc on line 1009". Am I missing a argument or something?
This is my function
Hook menu
function auto_form_menu() {
$items = array();
$items['admin/config/auto_form'] = array(
'title' => 'My Module',
'description' => 'description',
'page callback' => 'drupal_get_form',
'page arguments' => array('auto_form_records'),
'access arguments' => array('administer site configuration'),
'file' => 'auto_form.admin.inc'
);
$items['admin/config/auto_form/manage'] = array(
'title' => 'My Module',
'type' => MENU_DEFAULT_LOCAL_TASK,
'description' => 'description',
'weight' => -10,
);
return $items;
}
'auto_form.admin.inc'
function auto_form_records() {
$header = array('First Name', 'Last Name');
$dbresult = db_query("SELECT first, last FROM {auto}");
$rows = array();
foreach ($dbresult as $dbrow) {
$rows[] = array(
$dbrow->first,
$dbrow->last
);
}
return $output = theme('table', array('header' => $header, 'rows' => $rows));
}
Updated Code:
Any help is appreciated seeing how I am completely lost on figuring this out.