mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
Search in all tables
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1313 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -4,24 +4,10 @@ page_header(lang('Server'), "", null);
|
||||
?>
|
||||
<form action=""><p>
|
||||
<?php echo SID_FORM; ?>
|
||||
<input name="where[][val]" value="<?php echo h($_GET["where"][0]["val"]); ?>">
|
||||
<input name="where[0][val]" value="<?php echo h($_GET["where"][0]["val"]); ?>">
|
||||
<input type="submit" value="<?php echo lang('Search'); ?>" />
|
||||
</form>
|
||||
<?php
|
||||
if ($_GET["where"]) {
|
||||
$found = false;
|
||||
foreach (table_status() as $table => $table_status) {
|
||||
$name = $adminer->tableName($table_status);
|
||||
if (isset($table_status["Engine"]) && $name != "") {
|
||||
$result = $connection->query("SELECT 1 FROM " . idf_escape($table) . " WHERE " . implode(" AND ", $adminer->selectSearchProcess(fields($table), array())) . " LIMIT 1");
|
||||
if ($result->num_rows) {
|
||||
if (!$found) {
|
||||
echo "<ul>\n";
|
||||
$found = true;
|
||||
}
|
||||
echo "<li><a href='" . h(ME . "select=" . urlencode($table) . "&where[][val]=" . urlencode($_GET["where"][0]["val"])) . "'>" . h($name) . "</a>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo ($found ? "</ul>" : "<p class='message'>" . lang('No tables.')) . "\n";
|
||||
if ($_GET["where"][0]["val"] != "") {
|
||||
search_tables();
|
||||
}
|
||||
|
Reference in New Issue
Block a user