Something like:
$query = db_select('tablename');
$query->fields('tablename', array('field1'field1', field2''field2'));
$query->condition('field3', $var1);
$query->condition('field4', $var2);
$query->orderBy('field1', 'DESC');
$result = $query->execute();
foreach($result as $row){
// Debug
drupal_set_message('<pre>'.print_r($row,1).'</pre>');
}
More info: