I'm trying to learn how to make select queries with Drupal, so I made a form, and when I submit the form I try to query the database and get some results, but instead I'm redirected to an error page, here's how I select nodes from DB :
function my_module_form_submit($form, &$form_state)
{
$query = db_select('node', 'n')->extend('PagerDefault');
$query->condition('type', 'myContentType');
$result = $query->execute();
}