add get_pairs

This commit is contained in:
Shish 2011-01-01 16:27:56 +00:00
parent 07959b1fc8
commit 7684def0f8

View file

@ -359,6 +359,18 @@ class Database {
return $res;
}
/**
* Execute an SQL query and return the the first row => the second rown
*/
public function get_pairs($query, $args=array()) {
$stmt = $this->execute($query, $args);
$res = array();
foreach($stmt as $row) {
$res[$row[0]] = $row[1];
}
return $res;
}
/**
* Execute an SQL query and return a single value
*/