Allow specifying column in get_vals
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@608 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
d204a6ea15
commit
0bd864ea6f
|
@ -28,13 +28,13 @@ function optionlist($options, $selected = null) {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_vals($query) {
|
function get_vals($query, $column = 0) {
|
||||||
global $dbh;
|
global $dbh;
|
||||||
$return = array();
|
$return = array();
|
||||||
$result = $dbh->query($query);
|
$result = $dbh->query($query);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
while ($row = $result->fetch_row()) {
|
while ($row = $result->fetch_row()) {
|
||||||
$return[] = $row[0];
|
$return[] = $row[$column];
|
||||||
}
|
}
|
||||||
$result->free();
|
$result->free();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue