add get_pairs
This commit is contained in:
parent
07959b1fc8
commit
7684def0f8
@ -359,6 +359,18 @@ class Database {
|
|||||||
return $res;
|
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
|
* Execute an SQL query and return a single value
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user