Separate get_vals
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@144 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
1e0109cd2b
commit
7769f2c611
|
@ -49,11 +49,7 @@ function page_footer($missing = false) {
|
||||||
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
||||||
<?php
|
<?php
|
||||||
flush();
|
flush();
|
||||||
$result = $mysql->query("SHOW DATABASES");
|
echo optionlist(get_vals("SHOW DATABASES"), $_GET["db"], "not_vals");
|
||||||
while ($row = $result->fetch_row()) {
|
|
||||||
echo "<option" . ($row[0] == $_GET["db"] ? " selected='selected'" : "") . ">" . htmlspecialchars($row[0]) . "</option>\n";
|
|
||||||
}
|
|
||||||
$result->free();
|
|
||||||
?>
|
?>
|
||||||
</select><?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?></p>
|
</select><?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?></p>
|
||||||
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
||||||
|
|
|
@ -29,6 +29,17 @@ function optionlist($options, $selected = array(), $not_vals = false) {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_vals($query) {
|
||||||
|
global $mysql;
|
||||||
|
$result = $mysql->query($query);
|
||||||
|
$return = array();
|
||||||
|
while ($row = $result->fetch_row()) {
|
||||||
|
$return[] = $row[0];
|
||||||
|
}
|
||||||
|
$result->free();
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
function fields($table) {
|
function fields($table) {
|
||||||
global $mysql;
|
global $mysql;
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
Loading…
Reference in a new issue