mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 04:11:27 +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:
@@ -479,6 +479,30 @@ function process_input($field) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Print results of search in all tables
|
||||
* @uses $_GET["where"][0]
|
||||
* @uses $_POST["tables"]
|
||||
* @return null
|
||||
*/
|
||||
function search_tables() {
|
||||
global $adminer, $connection;
|
||||
$found = false;
|
||||
foreach (table_status() as $table => $table_status) {
|
||||
$name = $adminer->tableName($table_status);
|
||||
if (isset($table_status["Engine"]) && $name != "" && (!$_POST["tables"] || in_array($table, $_POST["tables"]))) {
|
||||
$result = $connection->query($q = "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[0][op]=" . urlencode($_GET["where"][0]["op"]) . "&where[0][val]=" . urlencode($_GET["where"][0]["val"])) . "'>" . h($name) . "</a>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo ($found ? "</ul>" : "<p class='message'>" . lang('No tables.')) . "\n";
|
||||
}
|
||||
|
||||
/** Print CSV row
|
||||
* @param array
|
||||
* @return null
|
||||
|
Reference in New Issue
Block a user